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"; } print_r($array); echo "----------\n"; foreach($array as $a) { echo $a . "\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.40.0110.00318.71
8.3.30.0070.00718.59
8.3.20.0080.00820.38
8.3.10.0000.00820.78
8.3.00.0050.00319.26
8.2.170.0120.00322.96
8.2.160.0100.00320.25
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0090.00019.89
8.2.120.0040.00426.35
8.2.110.0040.00422.25
8.2.100.0060.00617.67
8.2.90.0080.00019.29
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0060.00317.80
8.2.50.0090.00018.10
8.2.40.0000.00922.18
8.2.30.0040.00419.37
8.2.20.0000.00718.20
8.2.10.0080.00017.99
8.2.00.0000.00718.16
8.1.270.0000.00721.98
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0000.01022.70
8.1.230.0110.00018.80
8.1.220.0030.00617.79
8.1.210.0000.00818.77
8.1.200.0000.01117.47
8.1.190.0050.00317.35
8.1.180.0060.00318.10
8.1.170.0040.00418.38
8.1.160.0050.00319.07
8.1.150.0030.00618.89
8.1.140.0030.00619.50
8.1.130.0000.00718.75
8.1.120.0040.00417.50
8.1.110.0000.00817.42
8.1.100.0030.00317.50
8.1.90.0070.00017.42
8.1.80.0030.00317.49
8.1.70.0040.00417.38
8.1.60.0000.00917.59
8.1.50.0000.00717.51
8.1.40.0040.00417.46
8.1.30.0000.00917.63
8.1.20.0030.00517.57
8.1.10.0060.00317.50
8.1.00.0030.00617.38
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0060.00018.43
8.0.270.0000.00717.17
8.0.260.0000.00718.87
8.0.250.0000.00716.95
8.0.240.0070.00017.02
8.0.230.0000.00716.96
8.0.220.0030.00316.94
8.0.210.0000.00716.80
8.0.200.0030.00316.96
8.0.190.0030.00616.94
8.0.180.0030.00516.88
8.0.170.0050.00216.92
8.0.160.0000.00716.97
8.0.150.0030.00416.84
8.0.140.0040.00416.83
8.0.130.0000.00613.31
8.0.120.0000.00716.86
8.0.110.0000.00716.95
8.0.100.0040.00416.88
8.0.90.0030.00616.73
8.0.80.0060.00916.84
8.0.70.0030.00516.86
8.0.60.0040.00416.85
8.0.50.0050.00316.74
8.0.30.0050.01217.13
8.0.20.0130.00717.40
8.0.10.0040.00417.05
8.0.00.0130.00916.74
7.4.330.0050.00015.55
7.4.320.0000.00716.60
7.4.300.0000.00616.51
7.4.290.0000.00816.60
7.4.280.0040.00416.38
7.4.270.0070.00016.50
7.4.260.0030.00316.45
7.4.250.0040.00416.57
7.4.240.0070.00016.53
7.4.230.0040.00416.64
7.4.220.0120.00616.61
7.4.210.0080.00716.47
7.4.200.0030.00616.48
7.4.160.0100.00716.61
7.4.150.0140.00317.40
7.4.140.0120.00717.86
7.4.130.0160.00616.50
7.4.120.0100.00916.54
7.4.110.0030.01616.47
7.4.100.0000.02016.44
7.4.90.0190.00516.53
7.4.80.0120.00619.39
7.4.70.0080.01216.43
7.4.60.0180.00616.32
7.4.50.0070.00716.35
7.4.40.0070.01016.41
7.4.30.0130.00716.59
7.4.00.0030.01014.80
7.3.330.0060.00013.10
7.3.320.0050.00013.24
7.3.310.0030.00316.27
7.3.300.0030.00316.16
7.3.290.0020.00516.17
7.3.280.0090.00716.25
7.3.270.0120.00617.40
7.3.260.0060.01216.43
7.3.250.0110.00616.38
7.3.240.0110.00616.39
7.3.230.0090.00916.52
7.3.210.0120.00616.26
7.3.200.0090.01016.53
7.3.190.0100.00616.24
7.3.180.0090.00616.19
7.3.170.0130.00316.32
7.3.160.0100.00716.56
7.2.330.0090.00916.36
7.2.320.0090.01316.79
7.2.310.0070.01016.53
7.2.300.0120.00616.38
7.2.290.0070.00916.37
7.2.60.0000.00816.95
7.1.200.0000.00815.84
7.1.70.1170.00315.32
7.1.60.0350.01033.39
7.1.50.1010.01733.01
7.1.40.1650.01032.58
7.1.30.1710.01032.64
7.1.20.1860.00732.62
7.1.10.1080.01314.69
7.1.00.0050.01515.06
7.0.200.1340.01014.81
7.0.190.1490.01015.09
7.0.180.1060.01014.54
7.0.170.1570.01514.41
7.0.160.1630.01414.39
7.0.150.0050.01414.33
7.0.140.0150.00714.61
7.0.130.0080.01614.77
7.0.120.0120.01214.71
7.0.110.0130.00414.77
7.0.100.1440.00014.66
7.0.90.0100.00714.63
7.0.80.1620.00314.86
7.0.70.1360.01314.65
7.0.60.1180.01314.35
7.0.50.1280.01014.54
7.0.40.1440.01914.59
7.0.30.1610.00914.75
7.0.20.0170.00714.49
7.0.10.0130.01014.83
7.0.00.1230.00714.56

preferences:
56.86 ms | 400 KiB | 5 Q