3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(){ $variable = "first"; $closure = function() { global $variable; echo $variable . "\n"; }; $closure(); function test($closure) { global $variable; //Note the scope added here $variable = "second"; $closure(); } test($closure); } foo(); ?>

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.0140.00718.43
8.3.50.0160.00316.48
8.3.40.0120.00318.70
8.3.30.0120.00318.49
8.3.20.0050.00318.78
8.3.10.0040.00423.66
8.3.00.0040.00419.58
8.2.180.0140.00716.63
8.2.170.0180.00422.96
8.2.160.0040.00920.43
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00020.69
8.2.110.0030.00720.94
8.2.100.0080.00417.90
8.2.90.0000.00817.78
8.2.80.0040.00418.03
8.2.70.0060.00317.93
8.2.60.0060.00318.03
8.2.50.0080.00018.10
8.2.40.0030.00519.36
8.2.30.0040.00419.35
8.2.20.0040.00418.08
8.2.10.0000.00719.36
8.2.00.0050.00317.69
8.1.280.0120.00325.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00421.99
8.1.230.0080.00422.54
8.1.220.0030.00617.74
8.1.210.0060.00318.77
8.1.200.0060.00617.35
8.1.190.0000.00917.22
8.1.180.0000.00818.10
8.1.170.0080.00018.48
8.1.160.0040.00418.76
8.1.150.0000.00718.96
8.1.140.0030.00520.23
8.1.130.0020.00517.36
8.1.120.0050.00217.48
8.1.110.0040.00417.35
8.1.100.0070.00017.48
8.1.90.0070.00017.41
8.1.80.0030.00517.48
8.1.70.0000.00717.36
8.1.60.0050.00317.57
8.1.50.0030.00617.43
8.1.40.0050.00317.56
8.1.30.0040.00417.48
8.1.20.0000.00717.67
8.1.10.0030.00617.63
8.1.00.0040.00417.41
8.0.300.0000.00719.60
8.0.290.0080.00016.63
8.0.280.0030.00318.30
8.0.270.0030.00317.26
8.0.260.0000.00616.73
8.0.250.0000.00716.83
8.0.240.0030.00317.01
8.0.230.0030.00316.95
8.0.220.0000.00716.79
8.0.210.0070.00016.88
8.0.200.0080.00016.96
8.0.190.0080.00016.93
8.0.180.0040.00416.88
8.0.170.0060.00316.80
8.0.160.0030.00316.91
8.0.150.0000.00816.75
8.0.140.0050.00516.74
8.0.130.0050.00013.34
8.0.120.0020.00516.87
8.0.110.0000.00716.74
8.0.100.0040.00416.78
8.0.90.0040.00416.75
8.0.80.0120.00616.89
8.0.70.0060.00316.92
8.0.60.0070.00016.76
8.0.50.0030.00516.82
8.0.30.0080.01217.08
8.0.20.0130.01017.40
8.0.10.0040.00416.90
8.0.00.0070.01216.78
7.4.330.0030.00315.55
7.4.320.0030.00316.65
7.4.300.0030.00316.42
7.4.290.0000.00716.63
7.4.280.0070.00016.41
7.4.270.0030.00316.61
7.4.260.0030.00716.59
7.4.250.0000.00816.51
7.4.240.0000.00716.51
7.4.230.0000.00716.54
7.4.220.0000.00916.58
7.4.210.0100.00616.46
7.4.200.0000.00716.71
7.4.160.0090.00716.53
7.4.140.0130.00617.86
7.4.130.0150.00316.55
7.4.120.0120.00916.48
7.4.110.0130.00716.47
7.4.100.0110.00816.57
7.4.90.0030.01316.44
7.4.80.0100.00719.39
7.4.70.0090.01116.45
7.4.60.0190.00316.45
7.4.50.0090.00616.70
7.4.40.0060.01316.26
7.4.00.0110.00614.87
7.3.330.0000.00513.22
7.3.320.0000.00513.15
7.3.310.0000.00616.19
7.3.300.0060.00016.14
7.3.290.0040.00416.34
7.3.280.0060.01316.29
7.3.260.0130.00716.44
7.3.240.0090.00816.41
7.3.230.0080.00816.38
7.3.210.0110.00616.65
7.3.200.0060.01516.43
7.3.190.0130.00316.48
7.3.180.0110.00616.40
7.3.170.0130.00316.43
7.3.160.0090.01016.57
7.3.120.0030.01214.96
7.3.110.0030.01314.92
7.3.100.0070.01114.79
7.3.90.0110.00414.74
7.3.80.0040.01514.64
7.3.70.0030.00614.41
7.3.60.0070.01014.72
7.3.50.0070.01014.75
7.3.40.0070.01014.71
7.3.30.0030.00814.84
7.3.20.0060.00316.35
7.3.10.0050.00516.64
7.3.00.0100.00616.50
7.2.330.0030.01416.68
7.2.320.0090.00616.70
7.2.310.0140.00316.57
7.2.300.0000.02116.54
7.2.290.0090.00916.70
7.2.250.0060.00914.75
7.2.240.0060.01215.07
7.2.230.0000.01514.90
7.2.220.0070.01014.95
7.2.210.0100.01014.86
7.2.200.0090.00615.02
7.2.190.0030.00914.93
7.2.180.0000.01514.96
7.2.170.0040.00714.89
7.2.160.0080.00414.92
7.2.150.0060.00616.93
7.2.140.0090.00616.80
7.2.130.0070.00616.71
7.2.120.0020.01116.75
7.2.110.0500.00516.13
7.2.100.1470.01115.90
7.2.90.1270.00616.20
7.2.80.1110.01016.12
7.2.70.1320.00516.01
7.2.60.1560.01016.28
7.2.50.1330.01216.17
7.2.40.1460.00716.29
7.2.30.1320.00716.20
7.2.20.1630.01016.11
7.2.10.1190.00716.14
7.2.00.1510.00616.15
7.1.330.0110.00615.82
7.1.320.0060.00915.77
7.1.310.0030.00615.52
7.1.300.0060.00315.66
7.1.290.0040.00815.84
7.1.280.0110.00415.70
7.1.270.0000.00815.80
7.1.260.0030.00715.77
7.1.250.0060.00615.53
7.1.240.0050.00915.72
7.1.230.0660.00615.10
7.1.220.1380.00915.02
7.1.210.1500.00615.09
7.1.200.1070.00914.96
7.1.190.1530.00815.06
7.1.180.1660.00814.96
7.1.170.1350.00914.85
7.1.160.1220.01014.93
7.1.150.1260.00715.05
7.1.140.1420.00814.96
7.1.130.1650.00715.06
7.1.120.1510.00415.14
7.1.110.1610.00815.21
7.1.100.1400.00315.00
7.1.90.1580.00714.99
7.1.80.1570.00815.11
7.1.70.1810.00515.08
7.1.60.2280.00821.04
7.1.50.2610.00920.97
7.1.40.3030.00621.05
7.1.30.3100.00621.03
7.1.20.2960.00921.13
7.1.10.2980.01015.10
7.1.00.1560.00815.05
7.0.330.0050.01015.17
7.0.320.0040.01115.56
7.0.310.0140.00015.55
7.0.300.0100.00715.47
7.0.290.0030.01015.35
7.0.280.0030.00815.39
7.0.270.0070.00715.53
7.0.260.0100.00315.41
7.0.250.0000.01015.28
7.0.240.0030.01015.03
7.0.230.0080.00615.36
7.0.220.0050.00315.49
7.0.210.0070.00715.24
7.0.200.0080.00415.10
7.0.190.0040.00815.28
7.0.180.0030.00915.43
7.0.170.0070.00715.51
7.0.160.0030.00615.20
7.0.150.0070.00715.34
7.0.140.0070.01115.18
7.0.130.0080.00615.26
7.0.120.0040.01115.45
7.0.110.0000.01415.38
7.0.100.0100.00615.38
7.0.90.0100.00315.18
7.0.80.0080.00515.12
7.0.70.0000.01215.32
7.0.60.0070.00715.20
7.0.50.0070.00715.32
7.0.40.0070.00713.54
7.0.30.0060.00613.37
7.0.20.0040.00713.43
7.0.10.0000.00913.59
7.0.00.0050.00513.47
5.6.400.0070.00714.36
5.6.390.0000.00914.32
5.6.380.0070.00814.39
5.6.370.0060.00914.11
5.6.360.0070.00314.51
5.6.350.0080.00614.13
5.6.340.0060.00614.28
5.6.330.0120.00313.85
5.6.320.0100.00314.31
5.6.310.0040.00714.52
5.6.300.0060.00614.41
5.6.290.0120.00614.27
5.6.280.0030.00914.21
5.6.270.0070.00714.22
5.6.260.0030.01014.40
5.6.250.0060.00913.99
5.6.240.0120.00614.38
5.6.230.0070.01114.21
5.6.220.0040.01114.39
5.6.210.0000.01414.11
5.6.200.0030.00814.38
5.6.190.0060.00614.14
5.6.180.0160.00014.14
5.6.170.0120.00314.21
5.6.160.0040.01114.26
5.6.150.0060.01114.50
5.6.140.0060.00914.18
5.6.130.0030.01014.59
5.6.120.0030.01314.20
5.6.110.0100.00714.15
5.6.100.0040.00414.18
5.6.90.0030.00914.06
5.6.80.0040.00414.20
5.6.70.0000.01414.44
5.6.60.0070.01014.05
5.6.50.0030.00714.21
5.6.40.0100.00314.09
5.6.30.0040.01114.45
5.6.20.0030.01014.14
5.6.10.0070.00714.39
5.6.00.0030.01014.27

preferences:
63.11 ms | 400 KiB | 5 Q