3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits[0]["expiryDate"] = "20142646"; $fruits[1]["expiryDate"] = "20142643"; $fruits[2]["expiryDate"] = "201426445"; usort($fruits, "compareDates"); print_r($fruits); function compareDates($a, $b) { if (!(isset($a['expiryDate']) && isset($b['expiryDate']))) { return false; } $t1 = strtotime($a['expiryDate']); $t2 = strtotime($b['expiryDate']); if ( $t1 == $t2) { return 0; } return ( $t1 > $t2) ? +1 : -1 }

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)
5.4.320.4270.03719.08
5.4.310.2230.04018.89
5.4.300.3630.03719.22
5.4.290.3370.03719.05
5.4.280.2600.03719.06
5.4.270.1500.03318.86
5.4.260.1670.03718.85
5.4.250.1870.03719.21
5.4.240.3130.04018.88
5.4.230.2970.04319.31
5.4.220.3470.04019.05
5.4.210.3470.04019.05
5.4.200.2930.05019.30
5.4.190.3070.03719.08
5.4.180.3400.03319.07
5.4.170.3770.04719.18
5.4.160.3530.03019.17
5.4.150.4070.04019.13
5.4.140.3630.03016.38
5.4.130.3470.03316.35
5.4.120.3700.03316.35
5.4.110.3330.03716.58
5.4.100.3700.03316.58
5.4.90.3300.03716.56
5.4.80.3400.03316.39
5.4.70.3470.03016.43
5.4.60.3330.03716.53
5.4.50.2930.03716.34
5.4.40.3500.03016.23
5.4.30.3630.03316.52
5.4.20.3430.04016.42
5.4.10.3930.04316.16
5.4.00.3430.03315.82
5.3.290.3430.04014.75
5.3.280.2400.03014.65
5.3.270.3170.03714.65
5.3.260.2500.04314.68
5.3.250.3070.03714.54
5.3.240.3130.04014.66
5.3.230.3900.03714.57
5.3.220.3530.03014.61
5.3.210.3870.04714.66
5.3.200.3470.04014.66
5.3.190.3470.03714.59
5.3.180.3800.04014.49
5.3.170.3500.03314.64
5.3.160.3630.03314.57
5.3.150.3970.04314.62
5.3.140.3800.04314.46
5.3.130.3400.03714.46
5.3.120.3530.03714.66
5.3.110.3530.03714.64
5.3.100.3770.02714.03
5.3.90.4130.03314.18
5.3.80.3630.03714.03
5.3.70.3700.03014.10
5.3.60.3800.03313.93
5.3.50.4100.04313.86
5.3.40.3170.04314.01
5.3.30.3770.03313.81
5.3.20.3530.04013.70
5.3.10.3830.04013.73
5.3.00.3730.02713.55
5.2.170.3330.03011.27
5.2.160.3170.02711.16
5.2.150.3130.03011.11
5.2.140.2530.03011.23
5.2.130.3300.03311.02
5.2.120.3070.03011.03
5.2.110.3270.03311.03
5.2.100.3170.03011.32
5.2.90.2830.02711.03
5.2.80.3000.02711.00
5.2.70.2970.03011.26
5.2.60.3330.03711.06
5.2.50.2830.03311.02
5.2.40.2370.02311.15
5.2.30.2300.03310.98
5.2.20.2500.02310.95
5.2.10.2600.02710.87
5.2.00.2530.02310.77
5.1.60.2500.02010.06
5.1.50.2430.0239.93
5.1.40.2670.0239.88
5.1.30.2600.03010.35
5.1.20.1530.02310.30
5.1.10.2630.02710.06
5.1.00.2670.03010.16
5.0.50.1300.0278.45
5.0.40.1370.0208.64
5.0.30.1200.0278.28
5.0.20.1430.0178.29
5.0.10.1270.0208.07
5.0.00.1170.0308.19
4.4.90.1400.0136.79
4.4.80.1400.0136.79
4.4.70.1170.0176.79
4.4.60.1170.0176.79
4.4.50.1300.0136.79
4.4.40.1200.0236.79
4.4.30.1370.0176.79
4.4.20.1370.0136.79
4.4.10.1230.0136.79
4.4.00.1370.0276.79
4.3.110.1300.0206.79
4.3.100.1330.0176.79
4.3.90.1170.0136.79
4.3.80.1230.0236.79
4.3.70.1200.0176.79
4.3.60.1370.0136.79
4.3.50.1330.0206.79
4.3.40.1470.0276.79
4.3.30.0600.0136.79
4.3.20.0600.0136.79
4.3.10.0670.0206.79
4.3.00.0730.0276.79

preferences:
140.78 ms | 1394 KiB | 7 Q