3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($a) { if (!is_array($a) && ! $a instanceof \Traversable) { throw new \Exception("here"); } return implode(' ', $a); } $traversable = new ArrayObject(); $traversable['test'] = 'that'; echo test(['a', 'b', 'c']); echo test((array) $traversable);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0070.01018.43
8.3.50.0120.00617.93
8.3.40.0090.00618.89
8.3.30.0070.00719.09
8.3.20.0050.00320.38
8.3.10.0040.00423.66
8.3.00.0040.00419.12
8.2.180.0070.00718.16
8.2.170.0070.00722.96
8.2.160.0030.01322.30
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.19
8.2.110.0090.00020.41
8.2.100.0110.00017.72
8.2.90.0080.00020.60
8.2.80.0040.00418.02
8.2.70.0090.00017.91
8.2.60.0050.00518.16
8.2.50.0000.00818.10
8.2.40.0040.00419.53
8.2.30.0000.00719.25
8.2.20.0040.00417.67
8.2.10.0060.00318.06
8.2.00.0000.00717.68
8.1.280.0120.00925.92
8.1.270.0000.00918.85
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.71
8.1.230.0110.00020.88
8.1.220.0000.00817.74
8.1.210.0040.00419.00
8.1.200.0040.00417.23
8.1.190.0040.00417.35
8.1.180.0050.00318.97
8.1.170.0030.00618.71
8.1.160.0050.00218.96
8.1.150.0080.00018.93
8.1.140.0020.00517.37
8.1.130.0030.00317.84
8.1.120.0070.00017.47
8.1.110.0060.00317.46
8.1.100.0040.00417.33
8.1.90.0040.00417.37
8.1.80.0040.00417.45
8.1.70.0040.00417.31
8.1.60.0000.00917.51
8.1.50.0000.00817.43
8.1.40.0000.00817.40
8.1.30.0060.00317.58
8.1.20.0000.00717.64
8.1.10.0030.00517.52
8.1.00.0030.00617.49
8.0.300.0040.00419.89
8.0.290.0040.00416.75
8.0.280.0040.00418.50
8.0.270.0030.00317.18
8.0.260.0000.00617.26
8.0.250.0030.00316.96
8.0.240.0030.00316.83
8.0.230.0000.00716.86
8.0.220.0070.00016.79
8.0.210.0000.00716.83
8.0.200.0060.00017.02
8.0.190.0000.00716.99
8.0.180.0000.00716.95
8.0.170.0070.00016.92
8.0.160.0000.00716.88
8.0.150.0040.00416.92
8.0.140.0000.00916.84
8.0.130.0030.00313.36
8.0.120.0030.00616.86
8.0.110.0030.00516.96
8.0.100.0050.00316.79
8.0.90.0050.00216.87
8.0.80.0040.01116.88
8.0.70.0040.00416.93
8.0.60.0020.00516.95
8.0.50.0000.00816.74
8.0.30.0180.00917.11
8.0.20.0080.01117.40
8.0.10.0040.00417.06
8.0.00.0070.01016.84
7.4.330.0000.00515.20
7.4.320.0060.00016.65
7.4.300.0060.00016.56
7.4.290.0000.00716.65
7.4.280.0040.00416.41
7.4.270.0030.00316.53
7.4.260.0050.00516.48
7.4.250.0000.00816.48
7.4.240.0020.00516.50
7.4.230.0000.00716.70
7.4.220.0090.00916.46
7.4.210.0070.00716.40
7.4.200.0000.00716.41
7.4.160.0080.00816.59
7.4.150.0100.00917.40
7.4.140.0100.00617.86
7.4.130.0110.00716.54
7.4.120.0050.01316.48
7.4.110.0130.00516.59
7.4.100.0120.00616.62
7.4.90.0110.00716.43
7.4.80.0150.00619.39
7.4.70.0130.00316.47
7.4.60.0060.01016.57
7.4.50.0040.00416.60
7.4.40.0060.01016.51
7.4.30.0080.00816.73
7.4.00.0120.00514.95
7.3.330.0000.00513.39
7.3.320.0030.00313.24
7.3.310.0030.00316.37
7.3.300.0030.00316.37
7.3.290.0070.00716.37
7.3.280.0090.00816.36
7.3.270.0070.01117.40
7.3.260.0140.00516.52
7.3.250.0050.01416.36
7.3.240.0100.00716.26
7.3.230.0100.00616.39
7.3.210.0130.00316.49
7.3.200.0070.01119.39
7.3.190.0110.00516.59
7.3.180.0120.00316.33
7.3.170.0170.00316.46
7.3.160.0040.01116.55
7.3.120.0180.00614.48
7.3.110.0110.01114.71
7.3.100.0040.01114.84
7.3.90.0090.00314.84
7.3.80.0070.00714.73
7.3.70.0060.00614.71
7.3.60.0040.01114.49
7.3.50.0060.00614.86
7.3.40.0040.01114.61
7.3.30.0050.00814.80
7.3.20.0030.01016.71
7.3.10.0070.00716.77
7.3.00.0060.00316.37
7.2.330.0040.02016.45
7.2.320.0170.00016.64
7.2.310.0140.00316.73
7.2.300.0170.00616.72
7.2.290.0060.01116.61
7.2.250.0140.00914.89
7.2.240.0130.01015.06
7.2.230.0030.01014.98
7.2.220.0060.00315.08
7.2.210.0120.00314.83
7.2.200.0030.00914.67
7.2.190.0000.01615.11
7.2.180.0070.00314.70
7.2.170.0040.01114.90
7.2.60.0000.01616.95
7.2.00.0030.01419.02
7.1.330.0070.00715.70
7.1.320.0030.01015.55
7.1.310.0060.00915.62
7.1.300.0090.00615.58
7.1.290.0060.00315.46
7.1.280.0090.00015.85
7.1.270.0030.01215.76
7.1.260.0070.00715.90
7.1.200.0000.00615.91
7.1.100.0060.00318.00
7.1.70.0000.00717.26
7.1.60.0140.01119.22
7.1.50.0110.01116.63
7.1.00.0100.07022.48
7.0.200.0040.00416.89
7.0.140.0000.07021.97
7.0.60.0070.06019.91
7.0.50.0070.06717.83
7.0.40.0130.07020.14
7.0.30.0300.08020.16
7.0.20.0170.08320.30
7.0.10.0100.08020.08
7.0.00.0030.05020.14
5.6.280.0070.07021.07
5.6.210.0030.04720.66
5.6.200.0030.08718.23
5.6.190.0100.05020.63
5.6.180.0300.03020.52
5.6.170.0270.05020.40
5.6.160.0100.03320.44
5.6.150.0070.03718.29
5.6.140.0070.04718.18
5.6.130.0070.06018.26
5.6.120.0000.05321.02
5.6.110.0100.07721.00
5.6.100.0170.07020.98
5.6.90.0070.04020.97
5.6.80.0230.06720.41
5.5.350.0170.08020.43
5.5.340.0030.04017.96
5.5.330.0030.04320.25
5.5.320.0330.05720.25
5.5.310.0200.05320.36
5.5.300.0070.04717.98
5.5.290.0170.06318.01
5.5.280.0130.04020.77
5.5.270.0070.05320.98
5.5.260.0070.08320.85
5.5.250.0000.08720.68
5.5.240.0100.07320.16
5.4.450.0670.05019.63
5.4.440.0900.05019.27
5.4.430.0730.04719.43
5.4.420.0800.06019.28
5.4.410.0630.05319.16
5.4.400.0630.05719.26
5.4.390.0770.04719.14
5.4.380.0330.08318.68
5.4.370.0370.08018.74
5.4.360.0270.05318.68
5.4.350.0370.04718.59
5.4.340.0300.05318.75
5.4.320.0370.05318.57
5.4.310.0330.05018.49
5.4.300.0230.05718.46
5.4.290.0170.06018.57
5.4.280.0300.06018.72
5.4.270.0370.04718.57
5.4.260.0370.04718.72
5.4.250.0370.05318.46
5.4.240.0230.06018.62
5.4.230.0330.05018.63
5.4.220.0330.05718.59
5.4.210.0400.04018.51
5.4.200.0270.05316.61
5.4.190.0300.05018.55
5.4.180.0230.06018.72
5.4.170.0330.05318.71
5.4.160.0230.05718.66
5.4.150.0330.05018.72
5.4.140.0300.05016.44
5.4.130.0230.05316.44
5.4.120.0330.06016.29
5.4.110.0430.05016.26
5.4.100.0200.06016.30
5.4.90.0170.06316.23
5.4.80.0400.04716.41
5.4.70.0300.05016.30
5.4.60.0330.04316.42
5.4.50.0430.05316.14
5.4.40.0300.05316.26
5.4.30.0230.06016.38
5.4.20.0270.05316.25
5.4.10.0300.04716.16
5.4.00.0370.04315.78
5.3.290.0370.05714.66
5.3.280.0330.05014.65
5.3.270.0330.05014.62
5.3.260.0400.04314.64
5.3.250.0230.07314.77
5.3.240.0170.06014.63
5.3.230.0270.05314.88
5.3.220.0130.06714.64
5.3.210.0400.06714.56
5.3.200.0330.06014.67
5.3.190.0230.05314.55
5.3.180.0170.05314.61
5.3.170.0270.05314.73
5.3.160.0330.06314.77
5.3.150.0330.06314.73
5.3.140.0470.04714.66
5.3.130.0400.05714.59
5.3.120.0300.06014.59
5.3.110.0230.06714.71
5.3.100.0330.05714.24
5.3.90.0370.06714.00
5.3.80.0230.05014.13
5.3.70.0400.05714.13
5.3.60.0300.06314.11
5.3.50.0370.04314.11
5.3.40.0400.05714.04
5.3.30.0300.04714.00
5.3.20.0270.06713.82
5.3.10.0330.06313.79
5.3.00.0300.06313.63
5.2.170.0470.04011.25
5.2.160.0130.05311.24
5.2.150.0270.03711.20
5.2.140.0300.05711.28
5.2.130.0270.06711.19
5.2.120.0300.05311.13
5.2.110.0330.04011.16
5.2.100.0270.04711.20
5.2.90.0300.04311.14
5.2.80.0270.04711.11
5.2.70.0600.05311.14
5.2.60.0300.05011.09
5.2.50.0330.05011.12
5.2.40.0170.05311.13
5.2.30.0300.04711.07
5.2.20.0270.04711.00
5.2.10.0270.05011.08
5.2.00.0370.03710.82
5.1.60.0170.04010.03
5.1.50.0170.04710.07
5.1.40.0300.04310.09
5.1.30.0200.05010.45
5.1.20.0270.05010.48
5.1.10.0330.04010.14
5.1.00.0200.04010.20
5.0.50.0200.0208.54
5.0.40.0130.0308.59
5.0.30.0130.0508.32
5.0.20.0130.0378.29
5.0.10.0200.0278.38
5.0.00.0070.0478.35
4.4.90.0100.0206.82
4.4.80.0070.0306.82
4.4.70.0200.0236.82
4.4.60.0100.0306.82
4.4.50.0200.0206.82
4.4.40.0130.0376.82
4.4.30.0130.0276.82
4.4.20.0130.0176.82
4.4.10.0100.0236.82
4.4.00.0170.0336.82
4.3.110.0130.0236.82
4.3.100.0170.0236.82
4.3.90.0230.0206.82
4.3.80.0030.0436.82
4.3.70.0100.0236.82
4.3.60.0030.0306.82
4.3.50.0130.0236.82
4.3.40.0030.0436.82
4.3.30.0100.0276.82
4.3.20.0030.0336.82
4.3.10.0070.0336.82
4.3.00.0030.0237.30

preferences:
49.96 ms | 400 KiB | 5 Q