3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zero = 0; // global scope $f1 = function() use ($zero) { $one = 1; // third-level closure scope of f4 $f2 = function() use ($zero, $one) { $two = 2; // second-level closure scope of f4 $f3 = function() use ($zero, $one, $two) { $three = 3; // first-level closure scope of f4 global $f4 = function() use ($zero, $one, $two, $three) { $four = 4; // local scope of f4 echo $zero + $one + $two + $three + $four; }; }; }; }; var_dump($f4);

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)
5.4.340.0570.05719.09
5.4.320.0370.04019.13
5.4.310.0400.04018.85
5.4.300.0530.06019.06
5.4.290.0600.06018.94
5.4.280.0470.04319.19
5.4.270.0500.05719.09
5.4.260.0500.04019.22
5.4.250.0530.05718.94
5.4.240.0470.03318.94
5.4.230.0470.03319.30
5.4.220.0470.03719.15
5.4.210.0430.04319.30
5.4.200.0470.06719.14
5.4.190.0430.04018.84
5.4.180.0370.04019.13
5.4.170.0400.04319.08
5.4.160.0470.04019.00
5.4.150.0470.03019.06
5.4.140.0370.05316.41
5.4.130.0330.03316.51
5.4.120.0400.04316.46
5.4.110.0230.04316.60
5.4.100.0330.04716.41
5.4.90.0300.04716.61
5.4.80.0330.04016.40
5.4.70.0370.03316.30
5.4.60.0330.03716.43
5.4.50.0500.05016.48
5.4.40.0400.03316.21
5.4.30.0500.06016.25
5.4.20.0470.06316.53
5.4.10.0470.06016.25
5.4.00.0430.04016.11
5.3.290.0400.04314.59
5.3.280.0530.06714.63
5.3.270.0470.06014.52
5.3.260.0400.07014.62
5.3.250.0400.06714.77
5.3.240.0330.04314.61
5.3.230.0370.07014.52
5.3.220.0370.03314.80
5.3.210.0300.04014.57
5.3.200.0300.04014.63
5.3.190.0330.03714.70
5.3.180.0370.04014.50
5.3.170.0370.03314.58
5.3.160.0430.06314.66
5.3.150.0470.03314.59
5.3.140.0470.05314.61
5.3.130.0500.04314.64
5.3.120.0430.05714.61
5.3.110.0270.07014.71
5.3.100.0430.07014.05
5.3.90.0430.06714.01
5.3.80.0470.06013.95
5.3.70.0400.03314.04
5.3.60.0500.02713.94
5.3.50.0330.03714.03
5.3.40.0400.03014.08
5.3.30.0400.06013.90
5.3.20.0430.06013.68
5.3.10.0330.04013.57
5.3.00.0400.03713.56
5.2.170.0300.03311.00
5.2.160.0300.03010.99
5.2.150.0270.03310.99
5.2.140.0330.05711.00
5.2.130.0370.03710.96
5.2.120.0370.03711.04
5.2.110.0270.02711.04
5.2.100.0370.03310.95
5.2.90.0270.03310.95
5.2.80.0400.05310.95
5.2.70.0400.05311.03
5.2.60.0430.04311.20
5.2.50.0370.06011.12
5.2.40.0230.02710.83
5.2.30.0170.03010.83
5.2.20.0270.04710.97
5.2.10.0230.02310.78
5.2.00.0230.02710.79
5.1.60.0230.0279.89
5.1.50.0200.0379.96
5.1.40.0170.02710.07
5.1.30.0200.02310.40
5.1.20.0170.02710.35
5.1.10.0270.02710.00
5.1.00.0270.05010.05
5.0.50.0100.0309.29
5.0.40.0100.0409.29
5.0.30.0170.0539.29
5.0.20.0230.0379.29
5.0.10.0230.0339.29
5.0.00.0170.0479.29
4.4.90.0130.0339.29
4.4.80.0200.0279.29
4.4.70.0130.0339.29
4.4.60.0130.0309.29
4.4.50.0070.0179.29
4.4.40.0200.0479.29
4.4.30.0070.0209.29
4.4.20.0100.0279.29
4.4.10.0170.0339.29
4.4.00.0100.0409.29
4.3.110.0170.0339.29
4.3.100.0130.0239.29
4.3.90.0130.0279.29
4.3.80.0200.0479.29
4.3.70.0170.0339.29
4.3.60.0170.0339.29
4.3.50.0170.0309.29
4.3.40.0130.0539.29
4.3.30.0030.0339.29
4.3.20.0070.0409.29
4.3.10.0100.0239.29
4.3.00.0100.0309.29

preferences:
144.1 ms | 1394 KiB | 7 Q