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)
8.3.60.0070.01016.63
8.3.50.0140.00722.95
8.3.40.0070.00718.92
8.3.30.0080.00819.20
8.3.20.0050.00220.16
8.3.10.0080.00020.84
8.3.00.0000.00819.63
8.2.180.0120.00916.75
8.2.170.0140.00722.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0070.00020.91
8.2.110.0080.00020.52
8.2.100.0070.00418.22
8.2.90.0040.00419.34
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0000.00818.05
8.2.50.0030.00518.07
8.2.40.0050.00318.16
8.2.30.0040.00419.43
8.2.20.0040.00417.87
8.2.10.0000.00718.20
8.2.00.0040.00417.82
8.1.280.0080.00825.92
8.1.270.0030.00622.24
8.1.260.0030.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.18
8.1.230.0060.00619.08
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0040.00717.61
8.1.190.0000.00817.60
8.1.180.0040.00419.21
8.1.170.0040.00418.53
8.1.160.0000.00721.94
8.1.150.0000.00719.07
8.1.140.0040.00417.60
8.1.130.0000.00717.74
8.1.120.0030.00517.69
8.1.110.0030.00517.70
8.1.100.0040.00417.68
8.1.90.0070.00017.66
8.1.80.0070.00017.59
8.1.70.0030.00317.59
8.1.60.0070.00017.63
8.1.50.0050.00217.70
8.1.40.0000.00717.70
8.1.30.0080.00017.59
8.1.20.0040.00417.77
8.1.10.0030.00617.57
8.1.00.0080.00017.56
8.0.300.0060.00318.77
8.0.290.0000.00716.88
8.0.280.0030.00318.51
8.0.270.0080.00017.34
8.0.260.0080.00017.25
8.0.250.0000.00717.26
8.0.240.0040.00417.12
8.0.230.0000.00717.18
8.0.220.0040.00417.17
8.0.210.0000.01017.15
8.0.200.0060.00017.13
8.0.190.0030.00317.19
8.0.180.0000.00717.19
8.0.170.0000.00717.11
8.0.160.0000.00717.17
8.0.150.0040.00417.07
8.0.140.0000.00717.05
8.0.130.0030.00313.48
8.0.120.0060.00317.03
8.0.110.0040.00417.11
8.0.100.0040.00416.93
8.0.90.0040.00417.14
8.0.80.0120.00917.04
8.0.70.0040.00417.16
8.0.60.0070.00016.98
8.0.50.0080.00016.92
8.0.30.0090.00917.29
8.0.20.0140.00717.41
8.0.10.0030.00517.25
8.0.00.0060.01117.06
7.4.330.0020.00215.08
7.4.320.0060.00016.76
7.4.300.0060.00016.80
7.4.290.0000.00716.63
7.4.280.0070.00016.72
7.4.270.0030.00316.62
7.4.260.0050.00216.50
7.4.250.0040.00416.70
7.4.240.0040.00316.73
7.4.230.0070.00016.63
7.4.220.0050.01316.71
7.4.210.0030.01016.83
7.4.200.0040.00416.68
7.4.160.0170.00016.59
7.4.150.0160.00317.40
7.4.140.0110.00917.86
7.4.130.0100.00716.77
7.4.120.0110.00616.67
7.4.110.0090.00916.68
7.4.100.0090.00916.69
7.4.90.0110.00716.50
7.4.80.0100.01019.39
7.4.70.0070.01016.54
7.4.60.0100.00716.75
7.4.50.0030.00516.81
7.4.40.0090.01216.89
7.4.30.0030.01416.60
7.4.00.0090.00615.10
7.3.330.0000.00513.43
7.3.320.0000.00513.43
7.3.310.0030.00316.29
7.3.300.0060.00016.43
7.3.290.0070.00716.45
7.3.280.0100.00816.51
7.3.270.0120.00617.40
7.3.260.0070.01016.38
7.3.250.0100.01116.74
7.3.240.0060.01216.64
7.3.230.0150.00416.65
7.3.210.0180.00016.67
7.3.200.0200.00419.39
7.3.190.0130.00916.57
7.3.180.0030.01316.59
7.3.170.0130.00316.74
7.3.160.0090.00916.41
7.2.330.0110.01116.75
7.2.320.0090.00916.95
7.2.310.0000.01717.05
7.2.300.0100.00716.79
7.2.290.0140.00316.66
7.2.60.0060.00616.99
7.2.00.0110.01119.73
7.1.200.0260.00015.97
7.1.100.0060.00618.37
7.1.70.0000.00817.01
7.1.60.0070.01419.61
7.1.50.0100.01017.23
7.1.00.0070.07322.31
7.0.200.0030.00616.95
7.0.140.0070.07022.17
7.0.60.0030.05719.94
7.0.50.0000.05717.90
7.0.40.0070.08320.11
7.0.30.0270.08020.21
7.0.20.0200.05720.08
7.0.10.0130.08020.23
7.0.00.0100.06020.33
5.6.210.0070.08320.46
5.6.200.0000.07718.22
5.6.190.0130.03720.63
5.6.180.3700.04320.57
5.6.170.0330.08020.46
5.6.160.0030.08720.54
5.6.150.0030.07318.12
5.6.140.0170.07018.18
5.6.130.0000.08018.25
5.6.120.0130.03321.00
5.6.110.0100.08021.09
5.6.100.0070.06721.09
5.6.90.0100.06321.13
5.6.80.0030.04020.39
5.5.350.0330.07720.34
5.5.340.0170.07017.99
5.5.330.0130.08020.42
5.5.320.0230.03720.28
5.5.310.0100.04320.30
5.5.300.0030.07717.96
5.5.290.0170.07318.07
5.5.280.0200.03020.68
5.5.270.0070.03720.96
5.5.260.0070.04020.79
5.5.250.0100.08020.55
5.5.240.0070.07020.04
5.4.450.0730.04319.40
5.4.440.0270.04019.64
5.4.430.0730.05319.54
5.4.420.0800.04719.55
5.4.410.0870.06019.47
5.4.400.0700.05318.91
5.4.390.0600.05018.99
5.4.380.0230.05718.74
5.4.370.0200.05718.50
5.4.360.0400.03718.46
5.4.350.0370.06018.57
5.4.340.0400.05318.73
5.4.320.0090.03812.50
5.4.310.0070.04212.50
5.4.300.0080.03812.51
5.4.290.0120.04112.50
5.4.280.0070.04112.40
5.4.270.0090.03712.40
5.4.260.0110.05012.40
5.4.250.0080.05312.40
5.4.240.0120.04212.40
5.4.230.0150.04512.39
5.4.220.0060.04312.39
5.4.210.0030.03912.39
5.4.200.0100.03712.39
5.4.190.0050.04012.39
5.4.180.0080.03712.39
5.4.170.0050.03812.39
5.4.160.0080.03912.39
5.4.150.0060.03812.39
5.4.140.0100.04012.07
5.4.130.0100.03512.06
5.4.120.0050.03812.02
5.4.110.0060.04212.01
5.4.100.0080.03312.01
5.4.90.0060.03812.01
5.4.80.0080.03512.01
5.4.70.0050.03612.01
5.4.60.0040.03812.01
5.4.50.0070.03512.01
5.4.40.0070.03512.00
5.4.30.0040.03711.99
5.4.20.0070.04812.00
5.4.10.0100.04712.00
5.4.00.0050.05311.48
5.3.290.0080.04712.80
5.3.280.0080.05112.71
5.3.270.0070.05612.72
5.3.260.0060.05012.72
5.3.250.0070.04212.72
5.3.240.0120.05312.72
5.3.230.0070.03912.71
5.3.220.0130.05012.68
5.3.210.0090.04012.68
5.3.200.0080.03712.68
5.3.190.0050.04112.68
5.3.180.0110.03312.67
5.3.170.0070.05212.67
5.3.160.0070.04112.68
5.3.150.0090.04812.67
5.3.140.0090.03512.66
5.3.130.0090.03712.66
5.3.120.0080.04212.66
5.3.110.0060.04012.66
5.3.100.0070.03712.11
5.3.90.0090.03512.10
5.3.80.0120.04212.09
5.3.70.0120.03812.10
5.3.60.0070.04212.08
5.3.50.0080.03612.03
5.3.40.0070.03512.02
5.3.30.0060.03711.98
5.3.20.0050.04111.77
5.3.10.0080.03911.73
5.3.00.0080.04111.72
5.2.170.0080.0319.23
5.2.160.0050.0329.22
5.2.150.0100.0279.22
5.2.140.0110.0319.22
5.2.130.0100.0339.18
5.2.120.0100.0389.18
5.2.110.0100.0379.19
5.2.100.0100.0429.17
5.2.90.0090.0349.17
5.2.80.0070.0399.18
5.2.70.0090.0329.18
5.2.60.0100.0399.13
5.2.50.0100.0469.10
5.2.40.0110.0379.08
5.2.30.0090.0399.05
5.2.20.0060.0299.04
5.2.10.0040.0298.94
5.2.00.0040.0438.80
5.1.60.0090.0418.09
5.1.50.0050.0298.09
5.1.40.0060.0238.07
5.1.30.0090.0238.42
5.1.20.0040.0278.44
5.1.10.0080.0238.16
5.1.00.0050.0258.16
5.0.50.0040.0336.68
5.0.40.0030.0206.53
5.0.30.0040.0316.35
5.0.20.0040.0216.31
5.0.10.0050.0246.29
5.0.00.0030.0326.29
4.4.90.0050.0184.78
4.4.80.0060.0194.76
4.4.70.0050.0144.75
4.4.60.0060.0134.75
4.4.50.0030.0164.77
4.4.40.0040.0254.70
4.4.30.0030.0174.75
4.4.20.0060.0134.84
4.4.10.0040.0154.84
4.4.00.0010.0274.76
4.3.110.0020.0184.67
4.3.100.0070.0184.66
4.3.90.0030.0144.63
4.3.80.0020.0264.58
4.3.70.0030.0154.63
4.3.60.0040.0164.62
4.3.50.0040.0224.63
4.3.40.0080.0344.54
4.3.30.0060.0253.34
4.3.20.0060.0293.32
4.3.10.0030.0203.29
4.3.00.0070.01018.16

preferences:
56.33 ms | 401 KiB | 5 Q