3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 2, 3, 4, 3, 2, 1]; $j = count($a) - 1; $output = []; for($i = 0; $i > count($a); $i++) { echo 'ddd' ; // if ($a[$i] !== $a[$j]) { // $output = $a[$i]; // } $j--; } print_r($output);

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.0120.00318.55
8.3.50.0110.00720.20
8.3.40.0120.00319.84
8.3.30.0110.00418.72
8.3.20.0050.00224.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.170.0100.01018.86
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00426.16
8.2.110.0040.00420.52
8.2.100.0110.00017.88
8.2.90.0040.00417.75
8.2.80.0000.00818.66
8.2.70.0040.00417.50
8.2.60.0040.00417.63
8.2.50.0040.00418.04
8.2.40.0070.00018.03
8.2.30.0000.00718.05
8.2.20.0050.00319.17
8.2.10.0000.00718.18
8.2.00.0080.00019.31
8.1.270.0070.00024.66
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00322.13
8.1.230.0090.00320.97
8.1.220.0040.00418.60
8.1.210.0030.00618.77
8.1.200.0000.00817.22
8.1.190.0030.00617.23
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0030.00718.95
8.1.150.0000.00718.55
8.1.140.0040.00417.51
8.1.130.0000.00719.01
8.1.120.0060.00317.39
8.1.110.0070.00017.50
8.1.100.0050.00217.34
8.1.90.0080.00817.31
8.1.80.0130.00217.47
8.1.70.0150.00017.43
8.1.60.0120.00617.38
8.1.50.0170.00017.34
8.1.40.0170.00017.51
8.1.30.0120.00617.61
8.1.20.0110.00717.63
8.1.10.0060.01217.30
8.1.00.0140.00317.38
8.0.300.0050.00518.77
8.0.290.0030.00516.63
8.0.280.0030.00318.38
8.0.270.0000.00716.73
8.0.260.0060.00018.23
8.0.250.0030.00316.94
8.0.240.0000.00616.92
8.0.230.0000.00716.87
8.0.220.0150.00016.82
8.0.210.0070.00716.79
8.0.200.0120.00316.86
8.0.190.0110.00316.90
8.0.180.0090.00516.84
8.0.170.0070.00716.91
8.0.160.0100.00516.88
8.0.150.0120.00316.89
8.0.140.0150.00016.80
8.0.130.0100.00516.76
8.0.120.0110.00416.86
8.0.110.0060.00916.82
8.0.100.0110.00616.79
8.0.90.0130.00016.85
8.0.80.0100.00016.90
8.0.70.0130.00016.78
8.0.60.0100.00016.92
8.0.50.0000.01216.86
8.0.30.0090.00416.84
8.0.20.0140.00016.70
8.0.10.0060.00616.83
7.4.330.0000.00616.67
7.4.320.0000.00616.48
7.4.300.0100.00716.59
7.4.290.0110.00316.30
7.4.280.0150.00216.49
7.4.270.0110.00616.60
7.4.260.0080.00816.50
7.4.250.0140.00316.49
7.4.240.0130.00016.39
7.4.230.0080.00416.54
7.4.220.0080.00516.57
7.4.210.0050.00516.56
7.4.200.0050.00416.59
7.4.190.0090.00316.57
7.4.180.0090.00016.57
7.4.160.0050.00516.56
7.4.150.0030.00816.48
7.4.140.0090.00316.22
7.4.130.0080.00416.33
7.4.120.0050.00616.38
7.4.110.0070.00316.24
7.4.100.0110.00016.49
7.4.90.0100.00016.41
7.4.80.0080.00316.20
7.4.70.0030.00616.22
7.4.60.0060.00316.37
7.4.50.0110.00016.38
7.4.40.0090.00016.24
7.4.30.0000.01116.29
7.4.20.0050.00516.26
7.4.10.0040.00415.82
7.4.00.0080.00016.43

preferences:
58.74 ms | 400 KiB | 5 Q