3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today = date('Y-m-d'); $arr = array( [ 'id' => '1', 'date' => '2020-03-27', 'date_end' => '2020-05-02 17:00', 'date_res' => '2020-06-02' ], [ 'id' => '2', 'date' => '2020-04-27', 'date_end' => '2020-06-02 17:00', 'date_res' => '2020-08-02' ], [ 'id' => '3', 'date' => '2020-06-27', 'date_end' => '2020-07-02 17:00', 'date_res' => '2020-08-02' ], [ 'id' => '4', 'date' => '2021-01-01', 'date_end' => '2021-02-01 17:00', 'date_res' => '2021-03-01' ], [ 'id' => '5', 'date' => '2021-02-01', 'date_end' => '2021-03-01 17:00', 'date_res' => '2021-04-01' ], [ 'id' => '6', 'date' => '2021-05-01', 'date_end' => '2021-06-01 17:00', 'date_res' => '2021-08-01' ], [ 'id' => '7', 'date' => '2021-02-06', 'date_end' => '2021-01-29 17:00', 'date_res' => '2021-01-29' ], [ 'id' => '9', 'date' => '2021-04-27', 'date_end' => '2021-05-03 17:00', 'date_res' => '2021-05-03' ], [ 'id' => '10', 'date' => '2021-02-01', 'date_end' => '2021-02-06 17:00', 'date_res' => '2021-05-03' ], [ 'id' => '11', 'date' => '2021-02-02', 'date_end' => '2021-02-07 17:00', 'date_res' => '2021-05-05' ], [ 'id' => '12', 'date' => '2021-03-27', 'date_end' => '2021-02-07 17:00', 'date_res' => '2021-06-02' ]); usort($arr, function($dateA, $dateB) use ($today) { return abs(strtotime($dateA['date_res']) - strtotime($today)) - abs(strtotime($dateB['date_res']) - strtotime($today)); }); var_dump($arr);

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.5.00.0110.01320.14
8.4.150.0020.00014.05
8.4.140.0120.01117.63
8.4.130.0140.00618.08
8.4.120.0130.00620.63
8.4.110.0100.01122.61
8.4.100.0110.00918.17
8.4.90.0140.00820.90
8.4.80.0060.00318.86
8.4.70.0130.00920.71
8.4.60.0130.00820.70
8.4.50.0100.01217.88
8.4.40.0070.01017.94
8.4.30.0120.00920.46
8.4.20.0120.00917.93
8.4.10.0080.00026.10
8.3.280.0190.01118.84
8.3.270.0140.00716.81
8.3.260.0120.00816.66
8.3.250.0040.00319.05
8.3.240.0130.00916.70
8.3.230.0140.00616.75
8.3.220.0130.00718.84
8.3.210.0120.00816.76
8.3.200.0070.00316.82
8.3.190.0100.00916.72
8.3.180.0120.00716.77
8.3.170.0060.00316.68
8.3.160.0090.00920.19
8.3.150.0100.01017.22
8.3.140.0060.00317.43
8.3.130.0060.00316.70
8.3.120.0080.00018.95
8.3.110.0040.00420.94
8.3.100.0170.00324.06
8.3.90.0080.00026.77
8.3.80.0030.00616.75
8.3.70.0130.00718.50
8.3.60.0100.01018.56
8.3.50.0120.00924.64
8.3.40.0000.01519.06
8.3.30.0150.00418.97
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0070.00326.16
8.2.290.0080.01220.51
8.2.280.0070.00118.57
8.2.270.0080.00019.07
8.2.260.0060.01318.62
8.2.250.0140.00716.64
8.2.240.0090.00018.88
8.2.230.0110.01122.58
8.2.220.0130.00337.54
8.2.210.0160.00326.77
8.2.200.0050.00517.13
8.2.190.0120.00316.75
8.2.180.0080.01125.92
8.2.170.0190.00319.07
8.2.160.0110.00622.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0050.00326.35
8.2.110.0080.00321.06
8.2.100.0090.00319.76
8.2.90.0060.00317.91
8.2.80.0000.00819.11
8.2.70.0080.00017.75
8.2.60.0040.00418.18
8.2.50.0030.00618.07
8.2.40.0040.00421.08
8.2.30.0070.00019.29
8.2.20.0080.00018.09
8.2.10.0000.00819.38
8.2.00.0000.00719.33
8.1.330.0090.01120.25
8.1.320.0090.01118.00
8.1.310.0050.00318.57
8.1.300.0070.01016.22
8.1.290.0070.00318.88
8.1.280.0100.01325.92
8.1.270.0040.00424.66
8.1.260.0090.00028.09
8.1.250.0040.00428.09
8.1.240.0090.00022.14
8.1.230.0080.00419.04
8.1.220.0060.00317.91
8.1.210.0050.00318.77
8.1.200.0000.00917.60
8.1.190.0080.00017.24
8.1.180.0060.00318.10
8.1.170.0000.00817.62
8.1.160.0050.00318.93
8.1.150.0040.00418.88
8.1.140.0060.00319.00
8.1.130.0020.00618.20
8.1.120.0100.00317.61
8.1.110.0050.00917.66
8.1.100.0010.01117.65
8.1.90.0100.00417.63
8.1.80.0070.00717.65
8.1.70.0100.00217.56
8.1.60.0040.00717.69
8.1.50.0100.00417.65
8.1.40.0110.00417.71
8.1.30.0070.00817.72
8.1.20.0070.00717.69
8.1.10.0090.00617.66
8.1.00.0080.00717.70
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0040.00418.56
8.0.270.0000.00716.99
8.0.260.0070.00517.88
8.0.250.0080.00517.26
8.0.240.0080.00517.26
8.0.230.0060.00617.27
8.0.220.0060.00417.23
8.0.210.0080.00417.18
8.0.200.0100.00217.23
8.0.190.0020.00917.17
8.0.180.0090.00417.21
8.0.170.0090.00417.16
8.0.160.0030.00917.22
8.0.150.0070.00617.12
8.0.140.0070.00417.15
8.0.130.0070.00415.40
8.0.120.0050.00817.14
8.0.110.0060.00617.23
8.0.100.0030.00917.19
8.0.90.0100.00217.24
8.0.80.0080.00917.15
8.0.70.0070.00517.26
8.0.60.0080.00417.13
8.0.50.0060.00617.15
8.0.30.0170.00617.24
8.0.20.0110.00717.37
8.0.10.0070.01117.37
8.0.00.0110.00817.37
7.4.330.0040.00216.44
7.4.320.0060.00317.03
7.4.300.0030.00716.98
7.4.290.0060.00516.93
7.4.280.0020.00917.00
7.4.270.0080.00517.04
7.4.260.0050.00615.32
7.4.250.0060.00616.97
7.4.240.0080.00416.86
7.4.230.0060.00616.98
7.4.220.0090.00116.89
7.4.210.0070.01016.83
7.4.200.0110.00116.93
7.4.190.0060.01217.33
7.4.180.0050.01017.33
7.4.160.0120.00417.33
7.4.150.0120.00717.37
7.4.140.0130.00517.37
7.4.130.0150.00317.37
7.4.120.0120.00517.37
7.4.110.0120.00517.37
7.4.100.0160.00117.37
7.4.90.0170.00217.37
7.4.80.0070.01117.37
7.4.70.0090.00717.37
7.4.60.0100.00717.37
7.4.50.0130.00617.37
7.4.40.0120.00917.37
7.4.30.0110.00417.37
7.4.20.0100.00517.37
7.4.10.0110.00617.37
7.4.00.0100.00717.37
7.3.330.0060.00616.84
7.3.320.0070.00315.28
7.3.310.0080.00416.94
7.3.300.0080.00416.87
7.3.290.0100.00716.67
7.3.280.0100.00517.33
7.3.270.0100.00817.37
7.3.260.0090.00917.37
7.3.250.0080.01117.37
7.3.240.0130.00517.37
7.3.230.0100.01117.37
7.3.220.0120.00617.37
7.3.210.0110.00817.37
7.3.200.0150.00717.37
7.3.190.0100.00917.37
7.3.180.0150.00617.37
7.3.170.0080.01117.37
7.3.160.0120.00717.37
7.3.150.0140.00517.37
7.3.140.0110.00817.37
7.3.130.0140.00417.37
7.3.120.0140.00417.37
7.3.110.0130.00617.37
7.3.100.0140.00617.37
7.3.90.0150.00617.37
7.3.80.0130.00717.37
7.3.70.0140.00517.37
7.3.60.0110.01117.37
7.3.50.0090.00917.37
7.3.40.0120.00717.37
7.3.30.0210.00117.37
7.3.20.0240.00717.37
7.3.10.0170.01217.37
7.3.00.0200.00917.37

preferences:
35.73 ms | 403 KiB | 5 Q