3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(){ $sum = 0; return function ($i) use($sum) { $sum += $i; return $sum; }; } $myfunc = test(); for($i = 0; $i < 5; $i++){ echo $myfunc($i) . PHP_EOL; }

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.4.120.0110.00924.04
8.4.110.0120.01022.19
8.4.100.0130.00918.60
8.4.90.0110.01018.96
8.4.80.0090.01117.50
8.4.70.0120.00817.88
8.4.60.0080.01018.58
8.4.50.0120.00917.74
8.4.40.0160.00322.48
8.4.30.0130.00618.72
8.4.20.0100.01017.86
8.4.10.0080.01222.22
8.3.250.0100.00819.03
8.3.240.0060.00217.28
8.3.230.0160.00316.62
8.3.220.0120.00719.07
8.3.210.0120.00818.60
8.3.200.0150.00516.61
8.3.190.0080.00917.10
8.3.180.0060.00416.84
8.3.170.0160.00016.60
8.3.160.0090.00016.71
8.3.150.0050.01419.06
8.3.140.0030.00618.43
8.3.130.0050.00316.71
8.3.120.0000.01920.92
8.3.110.0170.00320.94
8.3.100.0060.00616.51
8.3.90.0000.00826.77
8.3.80.0060.00316.36
8.3.70.0150.00616.75
8.3.60.0040.01116.63
8.3.50.0070.00720.35
8.3.40.0000.01418.87
8.3.30.0030.01319.34
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0080.00920.73
8.2.280.0110.00718.31
8.2.270.0090.00917.25
8.2.260.0050.00316.61
8.2.250.0000.00918.23
8.2.240.0050.00317.25
8.2.230.0060.00322.58
8.2.220.0060.00324.06
8.2.210.0120.00626.77
8.2.200.0030.00916.75
8.2.190.0060.00918.41
8.2.180.0070.01125.92
8.2.170.0100.00318.96
8.2.160.0110.00422.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00420.98
8.2.110.0030.00720.52
8.2.100.0040.00717.84
8.2.90.0060.00317.91
8.2.80.0040.00419.23
8.2.70.0080.00017.50
8.2.60.0080.00017.93
8.2.50.0030.00618.07
8.2.40.0040.00419.89
8.2.30.0030.00518.00
8.2.20.0040.00420.36
8.2.10.0000.00818.02
8.2.00.0000.00719.18
8.1.330.0130.00722.06
8.1.320.0110.01115.97
8.1.310.0070.01018.42
8.1.300.0120.00320.28
8.1.290.0060.00330.84
8.1.280.0070.01025.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0070.01022.66
8.1.230.0110.00021.10
8.1.220.0030.00517.80
8.1.210.0000.00919.04
8.1.200.0000.00817.35
8.1.190.0040.00417.23
8.1.180.0000.00918.10
8.1.170.0030.00518.32
8.1.160.0030.00518.88
8.1.150.0030.00518.50
8.1.140.0040.00417.43
8.1.130.0000.00718.80
8.1.120.0080.00217.46
8.1.110.0000.00917.46
8.1.100.0000.00717.45
8.1.90.0000.00817.35
8.1.80.0030.00517.36
8.1.70.0000.00717.35
8.1.60.0080.00417.57
8.1.50.0160.00517.39
8.1.40.0180.00517.39
8.1.30.0170.00317.60
8.1.20.0140.00617.68
8.1.10.0170.00317.44
8.1.00.0120.00717.48
8.0.300.0080.00020.00
8.0.290.0000.00716.75
8.0.280.0040.00418.50
8.0.270.0070.00016.68
8.0.260.0020.00518.35
8.0.250.0080.00016.93
8.0.240.0040.00416.94
8.0.230.0000.00716.96
8.0.220.0000.00816.88
8.0.210.0000.00716.88
8.0.200.0040.00416.83
8.0.190.0070.00016.91
8.0.180.0060.00416.69
8.0.170.0090.00416.74
8.0.160.0040.00816.72
8.0.150.0050.00716.67
8.0.140.0100.00616.79
8.0.130.0140.00016.79
8.0.120.0060.00616.83
8.0.110.0060.00616.71
8.0.100.0070.00516.88
8.0.90.0080.00616.70
8.0.80.0110.00616.71
8.0.70.0090.00916.84
8.0.60.0160.00616.78
8.0.50.0150.00416.79
8.0.30.0140.00516.78
8.0.20.0140.00616.93
8.0.10.0160.00216.97
7.4.330.0000.00415.55
7.4.320.0030.00316.48
7.4.300.0000.00616.61
7.4.290.0130.00816.52
7.4.280.0130.00916.46
7.4.270.0110.00716.49
7.4.260.0200.00216.51
7.4.250.0150.00516.49
7.4.240.0140.00216.50
7.4.230.0180.00216.50
7.4.220.0140.00316.42
7.4.210.0140.00316.45
7.4.200.0080.01016.44
7.4.190.0170.00116.49
7.4.180.0110.00516.49
7.4.160.0150.00316.44
7.4.150.0130.00416.38
7.4.140.0060.00416.19
7.4.130.0140.00416.25
7.4.120.0100.00916.39
7.4.110.0190.00516.43
7.4.100.0240.00016.44
7.4.90.0140.00516.36
7.4.80.0160.00316.31
7.4.70.0150.00416.39
7.4.60.0140.00416.32
7.4.50.0090.00516.25
7.4.40.0070.00516.11
7.4.30.0090.00416.16
7.4.20.0050.00716.34
7.4.10.0100.00316.41
7.4.00.0060.00516.46

preferences:
28.78 ms | 403 KiB | 5 Q