3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [1,2,3,4,5]; $y = [2,3,4,5,7]; $z = [10,11,12,13,14]; $f = [2,3,4,5,14]; function check(array $x) { sort($x); $isStraight = true; $lastNum = $x[0]; for ($a = 1; $a < 5; $a ++) { if (($lastNum +1) != $x[$a]) { $isStraight = false; } $lastNum = $x[$a]; } if (!$isStraight && $x[0] == 2 && $x[4] == 14) { $x[4] = 1; $isStraight = check($x); } return $isStraight; } var_dump(check($x)); var_dump(check($y)); var_dump(check($z)); var_dump(check($f));

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.0100.01018.08
8.3.50.0100.00517.15
8.3.40.0070.01418.84
8.3.30.0090.00618.76
8.3.20.0050.00321.87
8.3.10.0070.00021.89
8.3.00.0030.00621.85
8.2.180.0070.00725.92
8.2.170.0110.00418.94
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0090.00019.31
8.2.110.0070.00321.02
8.2.100.0040.00818.03
8.2.90.0080.00017.88
8.2.80.0050.00317.97
8.2.70.0080.00017.93
8.2.60.0060.00318.16
8.2.50.0030.00518.10
8.2.40.0050.00219.40
8.2.30.0030.00520.45
8.2.20.0000.01018.00
8.2.10.0080.00019.17
8.2.00.0030.00618.05
8.1.280.0150.00025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0130.00628.09
8.1.240.0060.00322.16
8.1.230.0110.00022.82
8.1.220.0040.00417.88
8.1.210.0000.00818.77
8.1.200.0040.00417.38
8.1.190.0040.00417.35
8.1.180.0090.00018.10
8.1.170.0040.00418.49
8.1.160.0070.00018.91
8.1.150.0000.00718.83
8.1.140.0020.00518.88
8.1.130.0000.00720.30
8.1.120.0000.00717.45
8.1.110.0040.00417.46
8.1.100.0020.00517.52
8.1.90.0050.00317.43
8.1.80.0030.00617.52
8.1.70.0030.00617.37
8.1.60.0060.00317.63
8.1.50.0050.00317.54
8.1.40.0050.00317.50
8.1.30.0040.00417.61
8.1.20.0000.00817.66
8.1.10.0000.00817.59
8.1.00.0020.00517.47
8.0.300.0070.00021.94
8.0.290.0090.00316.63
8.0.280.0070.00018.36
8.0.270.0030.00317.27
8.0.260.0060.00018.50
8.0.250.0040.00416.86
8.0.240.0000.00616.91
8.0.230.0000.00716.91
8.0.220.0000.00716.82
8.0.210.0000.00816.90
8.0.200.0030.00316.93
8.0.190.0000.00716.86
8.0.180.0000.00716.93
8.0.170.0030.00616.92
8.0.160.0000.00716.95
8.0.150.0040.00416.79
8.0.140.0050.00316.79
8.0.130.0030.00313.29
8.0.120.0080.00016.82
8.0.110.0040.00416.81
8.0.100.0040.00416.76
8.0.90.0000.00816.72
8.0.80.0140.00616.88
8.0.70.0040.00416.74
8.0.60.0040.00416.89
8.0.50.0070.00016.78
8.0.30.0120.00616.91
8.0.20.0100.01016.84
8.0.10.0000.00716.83
8.0.00.0090.01116.68
7.4.330.0000.00616.63
7.4.320.0000.00616.62
7.4.300.0030.00316.55
7.4.290.0030.00316.53
7.4.280.0080.00016.64
7.4.270.0050.00316.59
7.4.260.0030.00316.35
7.4.250.0040.00416.47
7.4.240.0070.00016.58
7.4.230.0000.00716.42
7.4.220.0050.00216.50
7.4.210.0070.01116.55
7.4.200.0050.00216.67
7.4.160.0060.01016.45
7.4.140.0120.01517.86
7.4.130.0100.00716.54
7.4.120.0110.00916.54
7.4.110.0070.01016.41
7.4.100.0070.01016.43
7.4.90.0110.00816.64
7.4.80.0100.00719.39
7.4.70.0090.00616.49
7.4.60.0060.01216.48
7.4.50.0080.00316.48
7.4.40.0110.00616.37
7.4.00.0080.00615.14
7.3.330.0020.00213.38
7.3.320.0000.00613.30
7.3.310.0030.00316.19
7.3.300.0000.00716.32
7.3.290.0000.00616.38
7.3.280.0120.00516.34
7.3.260.0160.00816.54
7.3.240.0130.00716.46
7.3.230.0110.00816.35
7.3.210.0100.00716.44
7.3.200.0130.00416.34
7.3.190.0180.00716.34
7.3.180.0160.00016.47
7.3.170.0060.01216.65
7.3.160.0090.01316.48
7.3.40.0080.00314.68
7.3.30.0060.00914.79
7.3.20.0120.00914.59
7.3.10.0110.00715.07
7.3.00.0360.00314.55
7.2.330.0100.00716.53
7.2.320.0160.00616.75
7.2.310.0110.00516.80
7.2.300.0130.00316.58
7.2.290.0070.01016.51
7.2.170.0060.00915.02
7.2.160.0060.00915.15
7.2.150.0060.00815.26
7.2.140.0120.00615.21
7.2.130.0110.00414.88
7.2.120.0040.01115.00
7.2.110.0100.01715.14
7.2.100.0060.01015.18
7.2.90.0130.00615.18
7.2.80.0160.00315.14
7.2.70.0150.00914.90
7.2.60.0090.00915.02
7.2.50.0100.01015.35
7.2.40.0030.01015.01
7.2.30.0070.01915.16
7.2.20.0120.00315.13
7.2.10.0090.00915.23
7.2.00.0130.00615.22
7.1.280.0090.00614.12
7.1.270.0640.00613.81
7.1.260.0150.00913.83
7.1.250.0080.00613.72

preferences:
63.27 ms | 401 KiB | 5 Q