3v4l.org

run code in 300+ PHP versions simultaneously
<?php function straight($hand) { sort($hand); for ($i = 0; $i <= count($hand) - 5; $i++) { $subhand = array_slice($hand, $i, 5); if ($subhand == range($subhand[0], $subhand[count($subhand)-1])) { echo implode(',' , $hand) . " => straight\n"; break; } } } straight(array(2, 3, 5, 7, 12, 7, 4)); straight(array(2, 3, 5, 6, 12, 7, 4)); straight(array(7, 8, 9, 10, 11, 11, 11)); straight(array(2, 4, 5, 6, 14, 10, 9)); straight(array(2, 3, 5, 7, 7, 4)); straight(array(3, 5, 6, 12, 7, 4)); straight(array(7, 8, 9, 10, 11)); straight(array(2, 4, 5, 6, 3));

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.4.120.0090.00920.34
8.4.110.0090.01018.92
8.4.100.0100.01017.89
8.4.90.0140.00722.44
8.4.80.0130.00718.78
8.4.70.0130.00817.94
8.4.60.0100.01018.83
8.4.50.0140.00719.70
8.4.40.0040.00419.46
8.4.30.0120.00919.71
8.4.20.0070.01118.77
8.4.10.0100.01019.54
8.3.250.0040.00418.70
8.3.240.0100.00716.87
8.3.230.0060.01316.68
8.3.220.0030.00518.96
8.3.210.0060.00316.59
8.3.200.0090.01116.60
8.3.190.0040.00517.14
8.3.180.0070.01016.43
8.3.170.0040.01518.93
8.3.160.0120.00616.49
8.3.150.0120.00620.64
8.3.140.0120.00618.76
8.3.130.0070.00316.62
8.3.120.0070.01118.75
8.3.110.0060.00320.94
8.3.100.0030.00616.53
8.3.90.0000.00826.77
8.3.80.0040.00818.55
8.3.70.0140.00318.30
8.3.60.0070.01016.63
8.3.50.0090.00816.51
8.3.40.0080.00818.63
8.3.30.0150.00018.68
8.3.20.0030.00520.53
8.3.10.0100.00723.59
8.3.00.0040.00422.52
8.2.290.0110.00818.71
8.2.280.0050.01022.08
8.2.270.0150.00417.25
8.2.260.0030.00617.32
8.2.250.0000.00816.75
8.2.240.0100.01016.95
8.2.230.0040.00422.58
8.2.220.0070.00324.06
8.2.210.0120.00326.77
8.2.200.0030.00618.29
8.2.190.0060.00918.41
8.2.180.0000.01516.50
8.2.170.0120.00822.96
8.2.160.0130.01021.06
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00420.99
8.2.110.0060.00319.31
8.2.100.0080.00417.91
8.2.90.0050.00317.84
8.2.80.0040.00417.97
8.2.70.0030.00717.93
8.2.60.0040.00418.34
8.2.50.0030.00618.10
8.2.40.0030.00619.51
8.2.30.0000.00819.21
8.2.20.0030.00518.27
8.2.10.0040.00419.20
8.2.00.0040.00418.04
8.1.330.0090.01116.37
8.1.320.0150.00416.38
8.1.310.0090.00618.53
8.1.300.0170.00018.69
8.1.290.0030.00730.84
8.1.280.0080.00625.92
8.1.270.0080.00020.25
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00420.91
8.1.230.0040.00722.61
8.1.220.0000.00717.76
8.1.210.0090.00018.77
8.1.200.0040.00417.35
8.1.190.0040.00417.10
8.1.180.0060.00318.10
8.1.170.0000.00918.50
8.1.160.0000.00818.81
8.1.150.0040.00418.86
8.1.140.0000.00722.20
8.1.130.0080.00020.28
8.1.120.0000.00717.49
8.1.110.0050.00217.49
8.1.100.0000.00717.52
8.1.90.0080.00017.50
8.1.80.0070.00017.39
8.1.70.0060.00317.36
8.1.60.0060.00617.61
8.1.50.0080.00017.55
8.1.40.0030.00517.57
8.1.30.0040.00417.71
8.1.20.0040.00417.68
8.1.10.0060.00317.48
8.1.00.0040.00417.44
8.0.300.0000.00819.99
8.0.290.0080.00016.88
8.0.280.0040.00418.51
8.0.270.0030.00317.27
8.0.260.0080.00020.24
8.0.250.0000.00716.89
8.0.240.0030.00316.97
8.0.230.0000.00717.02
8.0.220.0030.00316.89
8.0.210.0030.00316.89
8.0.200.0030.00317.00
8.0.190.0040.00416.98
8.0.180.0080.00016.86
8.0.170.0030.00616.97
8.0.160.0000.00816.90
8.0.150.0060.00316.73
8.0.140.0050.00316.76
8.0.130.0070.00013.33
8.0.120.0000.00716.90
8.0.110.0030.00316.95
8.0.100.0030.00516.97
8.0.90.0040.00416.81
8.0.80.0100.00816.86
8.0.70.0050.00316.88
8.0.60.0040.00416.93
8.0.50.0030.00616.96
8.0.30.0070.00917.00
8.0.20.0150.00617.06
8.0.10.0050.00217.00
8.0.00.0120.00816.64
7.4.330.0060.00016.71
7.4.320.0040.00416.63
7.4.300.0000.00716.48
7.4.290.0030.00616.62
7.4.280.0000.00716.57
7.4.270.0070.00016.43
7.4.260.0030.00516.53
7.4.250.0030.00316.48
7.4.240.0080.00016.55
7.4.230.0000.00716.43
7.4.220.0030.00516.43
7.4.210.0090.00716.47
7.4.200.0000.00716.43
7.4.160.0100.00616.55
7.4.140.0060.01617.86
7.4.130.0110.00616.57
7.4.120.0060.01316.65
7.4.110.0060.01016.42
7.4.100.0100.00716.41
7.4.90.0060.01116.35
7.4.80.0130.01019.39
7.4.70.0120.00616.46
7.4.60.0070.00716.51
7.4.50.0050.00516.52
7.4.40.0070.00816.38
7.4.00.0110.00414.75
7.3.330.0020.00213.15
7.3.320.0030.00313.35
7.3.310.0030.00316.40
7.3.300.0060.00016.29
7.3.290.0030.01016.32
7.3.280.0070.00916.29
7.3.260.0080.01016.48
7.3.240.0130.00516.49
7.3.230.0100.00716.51
7.3.210.0120.00416.42
7.3.200.0120.00416.61
7.3.190.0130.00316.36
7.3.180.0140.00316.38
7.3.170.0140.00416.55
7.3.160.0090.00916.30
7.3.30.0100.00414.73
7.3.20.0570.00414.74
7.3.10.0580.00214.85
7.3.00.0540.00614.78
7.2.330.0110.00716.89
7.2.320.0030.01416.48
7.2.310.0120.00616.84
7.2.300.0070.01616.59
7.2.290.0090.00916.60
7.2.160.0080.01015.15
7.2.150.0550.00714.96
7.2.140.0610.00314.92
7.2.130.0450.01014.96
7.2.120.0490.00715.07
7.2.110.0480.00314.98
7.2.100.0460.00814.84
7.2.90.0450.01515.03
7.2.80.0610.00614.90
7.2.70.0990.00714.90
7.2.60.0510.00514.98
7.2.50.0550.00915.07
7.2.40.0560.00715.03
7.2.30.0530.00815.06
7.2.20.0480.00515.10
7.2.10.0590.00614.98
7.2.00.0640.00915.06
7.1.270.0720.00513.90
7.1.260.0340.00713.80
7.1.250.0610.00713.78

preferences:
142.99 ms | 403 KiB | 5 Q