3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2]; foreach($array as &$a) { if ($a == 1) { $array[] = 3; } echo $a . "\n"; } echo "----------\n"; foreach($array as $b) { echo $b. "\n"; }

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.0150.00018.18
8.3.50.0110.00718.32
8.3.40.0000.01418.73
8.3.30.0080.00618.48
8.3.20.0070.00020.34
8.3.10.0080.00020.80
8.3.00.0040.01120.82
8.2.180.0070.00716.63
8.2.170.0120.00322.96
8.2.160.0080.00619.41
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00319.89
8.2.120.0040.00426.35
8.2.110.0060.00322.29
8.2.100.0070.00417.66
8.2.90.0050.00319.20
8.2.80.0000.00817.97
8.2.70.0040.00417.75
8.2.60.0040.00418.05
8.2.50.0040.00418.16
8.2.40.0000.00722.23
8.2.30.0000.00819.20
8.2.20.0070.00018.05
8.2.10.0030.00518.11
8.2.00.0000.00718.11
8.1.280.0110.01125.92
8.1.270.0000.00822.05
8.1.260.0000.00926.35
8.1.250.0040.00428.09
8.1.240.0100.00022.58
8.1.230.0110.00018.96
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0000.00917.23
8.1.180.0000.00818.10
8.1.170.0040.00418.32
8.1.160.0000.00718.93
8.1.150.0050.00318.88
8.1.140.0000.00819.64
8.1.130.0020.00518.89
8.1.120.0030.00317.36
8.1.110.0000.00717.34
8.1.100.0040.00417.47
8.1.90.0000.00817.31
8.1.80.0000.00717.49
8.1.70.0050.00217.48
8.1.60.0080.00017.43
8.1.50.0000.00817.49
8.1.40.0040.00417.52
8.1.30.0030.00517.70
8.1.20.0000.00917.49
8.1.10.0000.00717.56
8.1.00.0040.00417.43
8.0.300.0000.00718.77
8.0.290.0080.00016.75
8.0.280.0040.00418.37
8.0.270.0000.00717.26
8.0.260.0040.00418.85
8.0.250.0040.00416.84
8.0.240.0000.00616.96
8.0.230.0040.00416.96
8.0.220.0050.00316.88
8.0.210.0040.00416.82
8.0.200.0030.00316.99
8.0.190.0070.00316.96
8.0.180.0040.00416.91
8.0.170.0000.00716.89
8.0.160.0040.00416.86
8.0.150.0040.00416.85
8.0.140.0050.00316.93
8.0.130.0000.00613.33
8.0.120.0080.00016.69
8.0.110.0050.00216.89
8.0.100.0040.00417.00
8.0.90.0050.00416.77
8.0.80.0090.01316.94
8.0.70.0030.00616.87
8.0.60.0050.00216.77
8.0.50.0000.00716.75
8.0.30.0110.01017.14
8.0.20.0130.00717.41
8.0.10.0040.00416.95
8.0.00.0130.00416.74
7.4.330.0000.00515.55
7.4.320.0070.00016.54
7.4.300.0030.00316.37
7.4.290.0040.00416.50
7.4.280.0000.00716.45
7.4.270.0030.00316.62
7.4.260.0030.00616.59
7.4.250.0000.00716.61
7.4.240.0070.00016.45
7.4.230.0080.00016.61
7.4.220.0150.00616.53
7.4.210.0090.00716.54
7.4.200.0040.00416.35
7.4.160.0140.00316.49
7.4.150.0130.00617.40
7.4.140.0100.01017.86
7.4.130.0120.00616.31
7.4.120.0070.01016.48
7.4.110.0040.01516.55
7.4.100.0090.00916.40
7.4.90.0110.00816.40
7.4.80.0150.00419.39
7.4.70.0150.00316.28
7.4.60.0190.00316.41
7.4.50.0040.01516.45
7.4.40.0120.00616.56
7.4.30.0070.01416.55
7.4.00.0030.01214.84
7.3.330.0050.00013.16
7.3.320.0000.00513.07
7.3.310.0040.00416.23
7.3.300.0040.00416.24
7.3.290.0070.00016.30
7.3.280.0090.00716.25
7.3.270.0090.01017.40
7.3.260.0140.00716.45
7.3.250.0090.01116.41
7.3.240.0090.00816.40
7.3.230.0070.01316.29
7.3.210.0100.00716.27
7.3.200.0130.00316.30
7.3.190.0080.00816.28
7.3.180.0110.00616.18
7.3.170.0120.00316.47
7.3.160.0030.01316.39
7.3.10.0060.00916.64
7.3.00.0090.00516.54
7.2.330.0070.01016.49
7.2.320.0040.01316.73
7.2.310.0150.00616.70
7.2.300.0040.01416.41
7.2.290.0060.01616.50
7.2.130.0080.00616.91
7.2.120.0030.01116.98
7.2.110.0050.00616.93
7.2.100.0060.00816.93
7.2.90.0030.01016.88
7.2.80.0030.01316.88
7.2.70.0040.01217.06
7.2.60.0070.00416.89
7.2.50.0100.00517.02
7.2.40.0060.00716.78
7.2.30.0050.00816.88
7.2.20.0050.00916.96
7.2.10.0090.00316.77
7.2.00.0060.00816.85
7.1.250.0040.00815.70
7.1.200.0030.00515.80
7.1.70.0120.01415.25
7.1.60.0220.02033.24
7.1.50.0320.01033.03
7.1.40.0250.00932.26
7.1.30.0330.01332.69
7.1.20.1970.00632.71
7.1.10.2040.01314.82
7.1.00.0740.01214.68
7.0.200.0150.00314.86
7.0.190.1630.01414.81
7.0.180.0080.00814.40
7.0.170.0090.01014.38
7.0.160.1430.01314.48
7.0.150.0150.00614.49
7.0.140.1530.01014.39
7.0.130.0040.01514.65
7.0.120.0120.00914.72
7.0.110.0150.00614.26
7.0.100.0110.01114.58
7.0.90.1670.00914.55
7.0.80.0060.01114.51
7.0.70.1500.00714.64
7.0.60.1370.00914.43
7.0.50.0340.00614.46
7.0.40.0120.00914.54
7.0.30.1650.01314.59
7.0.20.1720.01014.64
7.0.10.1670.00714.54
7.0.00.2020.01014.51

preferences:
60.64 ms | 401 KiB | 5 Q