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 $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.70.0110.00416.75
8.3.60.0150.00018.30
8.3.50.0120.00817.34
8.3.40.0070.00718.59
8.3.30.0000.01418.67
8.3.20.0080.00020.16
8.3.10.0050.00320.73
8.3.00.0080.00020.95
8.2.180.0030.01018.29
8.2.170.0150.00022.96
8.2.160.0090.00519.23
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00517.91
8.2.120.0080.00026.35
8.2.110.0070.00322.29
8.2.100.0120.00017.84
8.2.90.0040.00419.29
8.2.80.0000.00818.03
8.2.70.0040.00417.63
8.2.60.0090.00018.05
8.2.50.0000.00818.10
8.2.40.0000.00822.40
8.2.30.0080.00019.36
8.2.20.0040.00418.16
8.2.10.0000.00818.03
8.2.00.0020.00518.11
8.1.280.0040.01825.92
8.1.270.0080.00022.03
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00320.97
8.1.230.0070.00419.21
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0030.00617.36
8.1.190.0040.00417.35
8.1.180.0090.00018.10
8.1.170.0080.00018.65
8.1.160.0000.00718.92
8.1.150.0040.00418.88
8.1.140.0040.00419.57
8.1.130.0030.00618.99
8.1.120.0070.00017.45
8.1.110.0050.00317.51
8.1.100.0090.00017.37
8.1.90.0000.00817.31
8.1.80.0040.00417.39
8.1.70.0000.00717.50
8.1.60.0000.00717.59
8.1.50.0040.00417.43
8.1.40.0000.00817.38
8.1.30.0050.00317.59
8.1.20.0080.00017.65
8.1.10.0000.00817.56
8.1.00.0000.00917.45
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0030.00318.52
8.0.270.0030.00317.13
8.0.260.0030.00320.63
8.0.250.0030.00316.96
8.0.240.0040.00416.94
8.0.230.0040.00416.95
8.0.220.0070.00016.91
8.0.210.0030.00316.78
8.0.200.0030.00316.97
8.0.190.0030.00616.83
8.0.180.0050.00316.89
8.0.170.0000.00716.92
8.0.160.0050.00216.79
8.0.150.0070.00016.82
8.0.140.0000.00716.75
8.0.130.0030.00313.33
8.0.120.0020.00516.92
8.0.110.0040.00416.77
8.0.100.0030.00317.00
8.0.90.0000.00816.89
8.0.80.0070.01516.91
8.0.70.0040.00416.86
8.0.60.0040.00416.68
8.0.50.0040.00416.84
8.0.30.0070.01317.02
8.0.20.0090.01017.40
8.0.10.0000.00717.01
8.0.00.0090.00916.64
7.4.330.0000.00515.55
7.4.320.0030.00316.61
7.4.300.0030.00316.59
7.4.290.0040.00416.49
7.4.280.0000.00816.51
7.4.270.0070.00016.44
7.4.260.0040.00416.40
7.4.250.0030.00316.55
7.4.240.0000.00716.43
7.4.230.0070.00016.40
7.4.220.0110.00716.68
7.4.210.0040.01016.62
7.4.200.0000.00716.45
7.4.160.0050.01116.51
7.4.150.0090.00917.40
7.4.140.0110.00817.86
7.4.130.0070.01116.34
7.4.120.0130.00616.60
7.4.110.0060.01216.30
7.4.100.0070.01416.46
7.4.90.0070.01416.34
7.4.80.0120.00619.39
7.4.70.0170.00016.49
7.4.60.0000.01516.43
7.4.50.0070.00716.30
7.4.40.0070.01616.44
7.4.30.0090.00916.52
7.4.00.0070.00715.18
7.3.330.0050.00012.96
7.3.320.0000.00513.19
7.3.310.0030.00316.26
7.3.300.0030.00316.29
7.3.290.0000.00716.31
7.3.280.0070.00816.28
7.3.270.0090.01217.40
7.3.260.0130.00916.53
7.3.250.0100.00916.32
7.3.240.0060.01116.33
7.3.230.0170.00316.38
7.3.210.0100.00616.43
7.3.200.0110.00616.58
7.3.190.0120.00916.28
7.3.180.0060.01016.36
7.3.170.0120.00916.31
7.3.160.0060.00916.48
7.3.10.0020.01116.36
7.3.00.0090.00316.34
7.2.330.0150.00716.59
7.2.320.0070.01016.80
7.2.310.0060.01016.34
7.2.300.0110.00716.68
7.2.290.0120.01216.80
7.2.130.0060.00516.67
7.2.120.0040.00916.66
7.2.110.0060.01016.72
7.2.100.0060.01116.69
7.2.90.0160.00416.83
7.2.80.0170.00516.84
7.2.70.0140.01016.85
7.2.60.0090.00916.87
7.2.50.0120.00716.76
7.2.40.0140.00816.97
7.2.30.0140.00516.79
7.2.20.0050.00716.63
7.2.10.0160.00616.62
7.2.00.0060.01016.78
7.1.250.0040.01215.57
7.1.200.0030.01015.76
7.1.70.1200.01615.21
7.1.60.0350.01033.14
7.1.50.1190.02632.85
7.1.40.1110.01032.48
7.1.30.0950.01832.45
7.1.20.1370.01732.56
7.1.10.0630.01014.61
7.1.00.1150.01014.81
7.0.200.0840.01014.85
7.0.190.0890.00714.81
7.0.180.1800.00714.50
7.0.170.0960.01514.54
7.0.160.1000.01914.43
7.0.150.0690.01314.47
7.0.140.0660.01314.39
7.0.130.1340.00714.79
7.0.120.1160.00914.69
7.0.110.1100.00714.51
7.0.100.0690.01014.71
7.0.90.1280.01414.54
7.0.80.1170.01514.52
7.0.70.0890.01014.52
7.0.60.1050.01214.45
7.0.50.1360.01914.44
7.0.40.0140.00814.55
7.0.30.0150.00714.57
7.0.20.0080.01314.65
7.0.10.1320.01314.50
7.0.00.1280.01014.47

preferences:
47.55 ms | 401 KiB | 5 Q