3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['cat', 'dog', 'horse']; 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.0080.00816.58
8.3.60.0230.00018.43
8.3.50.0120.00917.28
8.3.40.0070.00718.85
8.3.30.0000.01418.54
8.3.20.0000.00720.16
8.3.10.0090.00020.84
8.3.00.0080.00020.80
8.2.180.0090.00618.29
8.2.170.0210.00018.79
8.2.160.0070.00719.26
8.2.150.0100.00025.66
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.05
8.2.110.0060.00322.14
8.2.100.0030.00917.90
8.2.90.0000.00917.91
8.2.80.0100.00018.98
8.2.70.0030.00618.03
8.2.60.0030.00618.09
8.2.50.0080.00018.10
8.2.40.0060.00322.31
8.2.30.0080.00019.27
8.2.20.0070.00017.94
8.2.10.0000.00718.06
8.2.00.0080.00018.17
8.1.280.0110.00425.92
8.1.270.0150.00324.66
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0080.00023.97
8.1.230.0060.00622.68
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0060.00617.48
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0040.00418.78
8.1.160.0000.00718.93
8.1.150.0000.00718.82
8.1.140.0080.00019.57
8.1.130.0050.00218.95
8.1.120.0030.00317.39
8.1.110.0000.00817.45
8.1.100.0000.00817.48
8.1.90.0040.00417.44
8.1.80.0040.00417.53
8.1.70.0000.00817.42
8.1.60.0000.00917.60
8.1.50.0080.00317.55
8.1.40.0040.00417.50
8.1.30.0030.00617.64
8.1.20.0040.00417.49
8.1.10.0060.00317.45
8.1.00.0030.00617.37
8.0.300.0040.00420.16
8.0.290.0040.00416.61
8.0.280.0070.00018.44
8.0.270.0000.00717.32
8.0.260.0030.00320.63
8.0.250.0030.00316.86
8.0.240.0040.00416.85
8.0.230.0070.00016.93
8.0.220.0070.00016.86
8.0.210.0000.00816.88
8.0.200.0040.00416.98
8.0.190.0090.00016.84
8.0.180.0030.00616.76
8.0.170.0030.00516.91
8.0.160.0060.00316.98
8.0.150.0030.00316.74
8.0.140.0000.00716.87
8.0.130.0030.00313.36
8.0.120.0050.00216.88
8.0.110.0030.00316.84
8.0.100.0040.00316.70
8.0.90.0030.00616.93
8.0.80.0060.01016.93
8.0.70.0040.00416.75
8.0.60.0000.00716.93
8.0.50.0000.00817.00
8.0.30.0080.00716.93
8.0.20.0100.00917.40
8.0.10.0070.00017.00
8.0.00.0170.00016.86
7.4.330.0000.00615.55
7.4.320.0000.00616.53
7.4.300.0000.00616.51
7.4.290.0070.00016.58
7.4.280.0000.00816.60
7.4.270.0030.00316.62
7.4.260.0040.00416.58
7.4.250.0040.00416.45
7.4.240.0030.00316.50
7.4.230.0000.00716.63
7.4.220.0100.01716.64
7.4.210.0050.01216.53
7.4.200.0000.00816.34
7.4.160.0090.00716.46
7.4.150.0170.00017.40
7.4.140.0090.01017.86
7.4.130.0130.00616.63
7.4.120.0090.00816.60
7.4.110.0110.00716.55
7.4.100.0100.00916.43
7.4.90.0110.00616.60
7.4.80.0150.00619.39
7.4.70.0150.00416.55
7.4.60.0070.01016.41
7.4.50.0130.00416.39
7.4.40.0080.00816.38
7.4.30.0090.01216.59
7.4.00.0080.00314.73
7.3.330.0030.00313.20
7.3.320.0000.00513.20
7.3.310.0030.00316.32
7.3.300.0070.00016.23
7.3.290.0030.00316.29
7.3.280.0100.00616.26
7.3.270.0160.00717.40
7.3.260.0070.01016.34
7.3.250.0110.00616.31
7.3.240.0130.00616.47
7.3.230.0170.00316.59
7.3.210.0120.00316.55
7.3.200.0090.00916.17
7.3.190.0080.00816.47
7.3.180.0090.00916.64
7.3.170.0110.00916.28
7.3.160.0070.01016.69
7.2.330.0170.00716.59
7.2.320.0130.00416.66
7.2.310.0070.01416.53
7.2.300.0090.00916.42
7.2.290.0100.01016.37
7.2.60.0000.00917.07
7.1.200.0070.00715.74
7.1.70.0060.00917.07
7.1.60.0150.01934.96
7.1.50.0140.01734.52
7.1.40.0270.01034.34
7.1.30.0280.01234.34
7.1.20.0250.01434.48
7.1.10.0040.01716.39
7.1.00.0100.01016.79
7.0.200.0030.01316.73
7.0.190.0100.01016.75
7.0.180.0080.00816.00
7.0.170.0150.00416.45
7.0.160.0040.01516.40
7.0.150.0070.01216.30
7.0.140.0090.00916.40
7.0.130.0140.00716.39
7.0.120.0120.00916.59
7.0.110.0060.01416.36
7.0.100.0090.00916.54
7.0.90.0090.00916.28
7.0.80.0070.01116.59
7.0.70.0140.00416.08
7.0.60.0090.00916.02
7.0.50.0040.01416.50
7.0.40.0110.00816.58
7.0.30.0060.01216.38
7.0.20.0130.00716.36
7.0.10.0070.01316.43
7.0.00.0140.00616.16

preferences:
70.1 ms | 401 KiB | 5 Q