3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [50, 50, 100, 175]; // no break $last = reset($array); $isSorted = true; foreach ($array as $value) { if ($last > $value) { $isSorted = false; break; } $last = $value; } var_export($isSorted); echo "\n---\n"; $array = [50, 150, 130, 175]; // break at third element: $array[2] $last = reset($array); $isSorted = true; foreach ($array as $value) { if ($last > $value) { $isSorted = false; break; } $last = $value; } var_export($isSorted);

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.0030.00524.06
8.4.110.0120.00818.77
8.4.100.0120.00818.71
8.4.90.0150.00820.39
8.4.80.0080.00418.91
8.4.70.0130.00617.60
8.4.60.0150.00518.63
8.4.50.0090.01319.50
8.4.40.0000.00817.44
8.4.30.0080.00020.41
8.4.20.0040.01217.82
8.4.10.0040.00419.59
8.3.250.0110.00818.81
8.3.240.0050.00317.17
8.3.230.0070.00216.73
8.3.220.0060.00219.12
8.3.210.0100.01116.62
8.3.200.0070.00216.73
8.3.190.0090.00617.26
8.3.180.0080.00716.48
8.3.170.0110.00717.16
8.3.160.0100.00718.20
8.3.150.0090.00920.60
8.3.140.0110.00316.55
8.3.130.0130.00318.36
8.3.120.0040.00420.80
8.3.110.0060.00320.94
8.3.100.0030.00616.62
8.3.90.0000.00726.77
8.3.80.0000.00816.63
8.3.70.0070.00716.50
8.3.60.0060.00918.31
8.3.50.0290.00523.69
8.3.40.0170.00018.66
8.3.30.0140.00018.64
8.3.20.0040.00420.77
8.3.10.0040.00421.64
8.3.00.0000.00919.55
8.2.290.0150.00420.25
8.2.280.0070.00118.46
8.2.270.0080.01118.63
8.2.260.0100.00718.71
8.2.250.0060.01016.41
8.2.240.0040.00419.04
8.2.230.0060.00322.58
8.2.220.0100.01024.06
8.2.210.0130.00626.77
8.2.200.0040.00416.38
8.2.190.0100.01016.58
8.2.180.0170.00016.48
8.2.170.0150.00018.96
8.2.160.0100.01022.96
8.2.150.0030.00525.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00821.07
8.2.110.0030.00620.39
8.2.100.0040.00817.72
8.2.90.0000.00719.23
8.2.80.0080.00019.36
8.2.70.0040.00417.63
8.2.60.0000.00817.63
8.2.50.0000.00818.05
8.2.40.0090.00319.82
8.2.30.0040.00419.54
8.2.20.0080.00018.11
8.2.10.0050.00219.31
8.2.00.0000.00719.36
8.1.330.0120.00621.75
8.1.320.0120.00816.26
8.1.310.0150.00018.41
8.1.300.0100.00018.53
8.1.290.0000.00830.84
8.1.280.0070.00725.92
8.1.270.0080.00022.13
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00322.46
8.1.230.0030.00720.84
8.1.220.0040.00418.77
8.1.210.0000.00818.97
8.1.200.0060.00317.51
8.1.190.0040.00417.23
8.1.180.0050.00518.10
8.1.170.0000.00817.62
8.1.160.0000.00718.93
8.1.150.0030.00518.89
8.1.140.0000.00818.80
8.1.130.0070.00017.45
8.1.120.0040.00417.34
8.1.110.0000.01017.46
8.1.100.0050.00217.46
8.1.90.0040.00417.32
8.1.80.0000.00717.40
8.1.70.0000.00717.47
8.1.60.0000.00917.59
8.1.50.0040.00417.41
8.1.40.0000.00817.53
8.1.30.0040.00417.48
8.1.20.0030.00617.50
8.1.10.0070.00017.48
8.1.00.0030.00817.37
8.0.300.0040.00420.03
8.0.290.0000.00716.75
8.0.280.0030.00318.36
8.0.270.0070.00018.04
8.0.260.0030.00316.83
8.0.250.0000.00616.97
8.0.240.0070.00216.85
8.0.230.0030.00516.82
8.0.220.0040.00416.84
8.0.210.0040.00416.78
8.0.200.0030.00316.89
8.0.190.0070.00016.93
8.0.180.0040.00416.84
8.0.170.0040.00416.79
8.0.160.0000.00716.81
8.0.150.0000.00716.93
8.0.140.0030.00516.73
8.0.130.0030.00313.32
8.0.120.0030.00616.87
8.0.110.0070.00016.87
8.0.100.0050.00216.78
8.0.90.0060.00316.79
8.0.80.0090.00616.80
8.0.70.0000.00816.93
8.0.60.0070.00016.85
8.0.50.0030.00616.88
8.0.30.0110.00616.80
8.0.20.0090.00917.41
8.0.10.0000.00816.93
8.0.00.0070.01016.98
7.4.330.0030.00316.66
7.4.320.0000.00616.61
7.4.300.0030.00316.60
7.4.290.0000.00716.59
7.4.280.0060.00316.58
7.4.270.0070.00016.54
7.4.260.0030.00313.36
7.4.250.0080.00016.53
7.4.240.0020.00516.45
7.4.230.0070.00016.49
7.4.220.0020.00516.45
7.4.210.0080.00816.50
7.4.200.0000.00716.39
7.4.130.0090.00916.50
7.4.120.0160.00616.46
7.4.110.0090.00916.43
7.4.100.0130.00916.34
7.4.90.0090.01016.44
7.4.80.0100.01319.39
7.4.70.0070.01416.62
7.4.60.0060.01616.50
7.4.50.0060.01016.21
7.4.40.0120.00916.44
7.4.20.0080.01216.57
7.4.10.0150.00016.43
7.4.00.0130.00316.34
7.3.330.0030.00616.34
7.3.320.0050.00013.22
7.3.310.0040.00416.32
7.3.300.0030.00316.31
7.3.290.0020.01716.35
7.3.260.0120.00416.32
7.3.240.0100.00816.36
7.3.230.0030.01416.49
7.3.210.0150.00316.28
7.3.200.0120.00416.25
7.3.190.0120.00616.22
7.3.180.0130.00316.46
7.3.170.0000.02016.61
7.3.160.0090.00916.36
7.3.140.0120.00916.28
7.3.130.0110.00416.55
7.3.120.0100.01016.34
7.3.110.0160.00416.45
7.3.100.0100.00516.15
7.3.90.0130.00316.25
7.3.80.0070.01016.23
7.3.70.0110.00716.33
7.3.60.0110.00316.34
7.3.50.0000.01516.45
7.3.40.0070.01016.31
7.3.30.0120.00316.38
7.3.20.0060.00916.26
7.3.10.0100.00716.30
7.3.00.0090.00616.32
7.2.330.0120.00716.40
7.2.320.0090.01216.68
7.2.310.0180.00316.45
7.2.300.0030.01316.80
7.2.290.0130.00316.77
7.2.270.0080.00816.74
7.2.260.0030.01316.34
7.2.250.0060.01316.67
7.2.240.0070.01316.67
7.2.230.0140.00416.83
7.2.220.0060.00916.73
7.2.210.0090.00616.32
7.2.200.0080.00816.55
7.2.190.0030.01216.45
7.2.180.0080.00816.61
7.2.170.0120.00316.38
7.2.160.0000.01716.68
7.2.150.0030.01716.70
7.2.140.0070.01016.77
7.2.130.0100.01716.70
7.2.120.0100.00916.53
7.2.110.0090.01216.44
7.2.100.0070.01116.65
7.2.90.0030.01316.65
7.2.80.0030.02016.80
7.2.70.0110.01116.68
7.2.60.0090.00616.60
7.2.50.0100.00716.38
7.2.40.0060.01316.61
7.2.30.0090.01816.46
7.2.20.0090.01316.51
7.2.10.0130.00316.64
7.2.00.0110.01116.52

preferences:
16.92 ms | 403 KiB | 5 Q