3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 10; function outer($x) { function inner($y) { global $x; // uses the actually global $x from line 2, not the param from line 3 return $x + $y; } return inner(5); } echo outer(5); // expected: 10, actual: 15 /* $z = 10; function outer2($z) { function inner($w) use ($z) { // syntax error, function (...) use (...) form is reserved for closures return $z + $w; } return inner(5); } echo outer2(5); // expected: 10, actual: syntax error */

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.70.0170.00318.52
8.3.60.0070.01416.50
8.3.50.0130.00521.83
8.3.40.0080.00818.67
8.3.30.0080.01118.73
8.3.20.0040.00418.84
8.3.10.0040.00421.60
8.3.00.0000.00722.44
8.2.190.0150.00616.58
8.2.180.0130.01016.48
8.2.170.0150.00022.96
8.2.160.0100.00719.41
8.2.150.0040.00424.18
8.2.140.0050.00524.66
8.2.130.0040.00426.16
8.2.120.0070.00020.75
8.2.110.0060.00319.23
8.2.100.0080.00417.84
8.2.90.0050.00319.05
8.2.80.0060.00317.97
8.2.70.0000.00917.62
8.2.60.0060.00317.80
8.2.50.0000.01218.10
8.2.40.0090.00021.94
8.2.30.0050.00319.11
8.2.20.0060.00317.65
8.2.10.0000.00717.93
8.2.00.0050.00517.64
8.1.280.0120.00325.92
8.1.270.0000.00822.03
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00621.23
8.1.230.0070.00417.42
8.1.220.0040.00417.76
8.1.210.0040.00418.77
8.1.200.0000.01217.13
8.1.190.0060.00617.22
8.1.180.0040.00418.10
8.1.170.0050.00518.37
8.1.160.0070.00022.18
8.1.150.0080.00018.92
8.1.140.0000.00819.55
8.1.130.0050.00317.75
8.1.120.0070.00017.44
8.1.110.0040.00417.46
8.1.100.0000.00717.40
8.1.90.0050.00217.41
8.1.80.0030.00517.47
8.1.70.0040.00417.43
8.1.60.0040.00417.62
8.1.50.0080.00017.41
8.1.40.0090.00017.52
8.1.30.0000.00917.56
8.1.20.0000.00717.58
8.1.10.0080.00017.38
8.1.00.0000.00817.36
8.0.300.0030.00618.77
8.0.290.0000.00716.63
8.0.280.0000.00718.30
8.0.270.0090.00017.20
8.0.260.0030.00616.78
8.0.250.0000.00617.04
8.0.240.0000.00717.05
8.0.230.0030.00316.93
8.0.220.0000.00716.96
8.0.210.0060.00316.81
8.0.200.0040.00416.95
8.0.190.0040.00416.98
8.0.180.0040.00416.85
8.0.170.0000.00716.95
8.0.160.0000.00816.82
8.0.150.0070.00016.95
8.0.140.0000.00716.93
8.0.130.0030.00313.32
8.0.120.0000.00816.91
8.0.110.0040.00416.87
8.0.100.0040.00416.91
8.0.90.0090.00016.84
8.0.80.0000.01716.82
8.0.70.0070.00016.95
8.0.60.0050.00316.82
8.0.50.0000.00816.79
8.0.30.0150.00317.32
8.0.20.0100.01017.40
8.0.10.0000.00816.95
8.0.00.0070.01016.96
7.4.330.0000.00515.20
7.4.320.0040.00416.56
7.4.300.0030.00316.63
7.4.290.0000.00716.38
7.4.280.0040.00416.34
7.4.270.0050.00216.61
7.4.260.0040.00416.61
7.4.250.0000.00716.54
7.4.240.0000.00816.57
7.4.230.0040.00416.46
7.4.220.0070.01116.36
7.4.210.0150.00016.47
7.4.200.0000.00716.68
7.4.160.0090.00616.42
7.4.150.0170.00017.40
7.4.140.0100.00717.86
7.4.130.0080.00916.48
7.4.120.0070.01216.49
7.4.110.0130.00316.39
7.4.100.0100.00716.44
7.4.90.0090.00916.53
7.4.80.0130.00719.39
7.4.70.0110.00716.63
7.4.60.0070.01016.52
7.4.50.0000.01216.55
7.4.40.0080.00816.56
7.4.30.0030.01316.35
7.4.00.0100.00614.97
7.3.330.0000.00513.27
7.3.320.0000.00513.07
7.3.310.0040.00416.15
7.3.300.0040.00216.16
7.3.290.0050.00916.29
7.3.280.0100.00816.26
7.3.270.0070.01017.40
7.3.260.0110.01016.20
7.3.250.0080.01216.34
7.3.240.0130.01016.53
7.3.230.0100.01316.39
7.3.210.0100.00716.28
7.3.200.0110.00616.32
7.3.190.0130.00416.32
7.3.180.0130.00316.58
7.3.170.0130.00916.24
7.3.160.0090.00916.48
7.3.120.0040.01414.87
7.3.110.0070.01014.82
7.3.100.0060.00714.72
7.3.90.0060.00415.01
7.3.80.0040.00914.75
7.3.70.0040.00914.84
7.3.60.0090.00714.65
7.3.50.0060.00614.83
7.3.40.0020.01014.84
7.3.30.0080.00314.74
7.3.20.0030.00916.69
7.3.10.0060.00916.58
7.3.00.0070.00916.55
7.2.330.0070.01016.60
7.2.320.0050.01616.66
7.2.310.0120.01216.67
7.2.300.0090.01216.61
7.2.290.0100.00716.45
7.2.250.0080.00915.01
7.2.240.0090.01014.68
7.2.230.0050.01014.98
7.2.220.0060.00715.12
7.2.210.0090.00514.81
7.2.200.0020.01115.11
7.2.190.0030.01214.90
7.2.180.0050.00914.67
7.2.170.0090.00414.88
7.2.00.0040.00819.34
7.1.330.0060.00915.68
7.1.320.0050.01015.68
7.1.310.0060.00715.63
7.1.300.0100.00515.45
7.1.290.0020.01115.70
7.1.280.0020.00915.66
7.1.270.0030.01015.77
7.1.260.0110.00215.79
7.1.70.0000.00817.13
7.1.60.0100.00017.16
7.1.00.0100.07322.37
7.0.200.0330.00414.94
7.0.100.0100.05320.23
7.0.90.0230.05719.92
7.0.80.0130.07320.02
7.0.70.0130.05320.04
7.0.60.0200.05020.15
7.0.50.0270.04320.46
7.0.40.0170.05320.39
7.0.30.1430.06020.32
7.0.20.0170.05720.34
7.0.10.0070.06720.43
7.0.00.0230.05020.33
5.6.250.0130.05320.88
5.6.240.0100.05720.62
5.6.230.0030.07320.61
5.6.220.0330.03020.50
5.6.210.0070.05720.70
5.6.200.0070.07721.19
5.6.190.0100.05721.09
5.6.180.0230.05021.09
5.6.170.0100.05321.11
5.6.160.0230.04721.21
5.6.150.0100.06321.07
5.6.140.0130.05021.09
5.6.130.0100.06721.11
5.6.120.0170.07721.05
5.6.110.0070.06321.09
5.6.100.0030.06321.08
5.6.90.0130.05721.08
5.6.80.0000.06720.56
5.6.70.0130.07720.53
5.6.60.0100.07720.46
5.6.50.0170.05020.57
5.6.40.0130.07320.45
5.6.30.0130.07320.55
5.6.20.0200.07020.49
5.6.10.0230.07020.51
5.6.00.0070.08720.43

preferences:
18.98 ms | 401 KiB | 5 Q