3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sql = array( array( 'date_max' => '2019-12-15', 'id_property' => 18, 'last_validation' => 1 ), array( 'date_max' => '2020-08-31', 'id_property' => 18, 'last_validation' => 5 ), array( 'date_max' => '2019-12-15', 'id_property' => 21, 'last_validation' => 1 ) ); $data = []; //create array of results grouped by the property id foreach($sql as $current_key => $current_array) { $ts = strtotime($current_array['date_max']); //unix timestamp from date $data[$current_array['id_property']][$ts] = $current_array; } $maxData = []; foreach($data as $propertId=>$values) { ksort($values); //sort by key, highest value first $maxData[] = array_pop($values); //take first value } print_r($maxData);

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.30.0130.00517.34
8.5.20.0060.01219.43
8.5.10.0120.00816.80
8.5.00.0120.01120.03
8.4.180.0170.00721.74
8.4.170.0110.01120.63
8.4.160.0110.01024.00
8.4.150.0060.00716.86
8.4.140.0140.00917.71
8.4.130.0130.00718.63
8.4.120.0120.00724.18
8.4.110.0050.00422.52
8.4.100.0110.01018.52
8.4.90.0130.00718.90
8.4.80.0040.00420.30
8.4.70.0050.00417.96
8.4.60.0070.01017.61
8.4.50.0120.00918.09
8.4.40.0070.01418.05
8.4.30.0060.01320.32
8.4.20.0080.01119.91
8.4.10.0100.00719.53
8.3.300.0150.00620.85
8.3.290.0130.00720.52
8.3.280.0140.00618.61
8.3.270.0110.00816.79
8.3.260.0110.01116.71
8.3.250.0130.00719.02
8.3.240.0050.00317.29
8.3.230.0060.00616.93
8.3.220.0040.00518.95
8.3.210.0080.00216.63
8.3.200.0100.01016.66
8.3.190.0040.00716.75
8.3.180.0040.00416.81
8.3.170.0110.00716.76
8.3.160.0040.00418.45
8.3.150.0090.00917.34
8.3.140.0000.01520.70
8.3.130.0080.00018.40
8.3.120.0130.00718.64
8.3.110.0060.00320.32
8.3.100.0090.00018.55
8.3.90.0100.01026.77
8.3.80.0080.00316.88
8.3.70.0000.01516.88
8.3.60.0030.01218.68
8.3.50.0140.00718.23
8.3.40.0070.01323.74
8.3.30.0080.00818.83
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.300.0140.00822.27
8.2.290.0120.00720.58
8.2.280.0120.00718.43
8.2.270.0200.00016.81
8.2.260.0070.01116.74
8.2.250.0050.00316.71
8.2.240.0030.00617.23
8.2.230.0080.00020.94
8.2.220.0060.00324.06
8.2.210.0100.01026.77
8.2.200.0040.00416.63
8.2.190.0090.00616.63
8.2.180.0140.00325.92
8.2.170.0080.00822.96
8.2.160.0100.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00726.16
8.2.110.0030.00620.52
8.2.100.0090.00317.91
8.2.90.0040.00418.00
8.2.80.0050.00518.88
8.2.70.0040.00417.75
8.2.60.0000.00817.88
8.2.50.0000.01017.75
8.2.40.0000.00819.61
8.2.30.0040.00419.71
8.2.20.0070.00318.21
8.2.10.0000.00819.36
8.2.00.0030.00619.38
8.1.340.0090.01017.66
8.1.330.0150.00421.97
8.1.320.0140.00618.09
8.1.310.0070.01018.68
8.1.300.0100.00017.99
8.1.290.0070.00418.88
8.1.280.0090.00625.92
8.1.270.0070.00320.77
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00923.86
8.1.230.0080.00423.73
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0000.00817.47
8.1.190.0030.00617.48
8.1.180.0030.00518.10
8.1.170.0040.00417.64
8.1.160.0000.00718.83
8.1.150.0040.00418.82
8.1.140.0000.00820.86
8.1.130.0040.00418.92
8.1.120.0050.00317.55
8.1.110.0000.00817.55
8.1.100.0040.00417.54
8.1.90.0080.00017.54
8.1.80.0030.00717.58
8.1.70.0000.00717.68
8.1.60.0050.00317.71
8.1.50.0040.00417.66
8.1.40.0040.00417.66
8.1.30.0040.00417.77
8.1.20.0030.00617.80
8.1.10.0000.00817.72
8.1.00.0040.00417.67
8.0.300.0000.00918.77
8.0.290.0050.00317.00
8.0.280.0030.00318.21
8.0.270.0040.00416.98
8.0.260.0030.00318.56
8.0.250.0000.00817.06
8.0.240.0030.00617.20
8.0.230.0030.00317.20
8.0.220.0040.00417.14
8.0.210.0000.00717.12
8.0.200.0080.00017.12
8.0.190.0000.00717.19
8.0.180.0030.00616.95
8.0.170.0060.00316.98
8.0.160.0040.00417.11
8.0.150.0030.00416.92
8.0.140.0000.00717.06
8.0.130.0000.00613.42
8.0.120.0040.00416.94
8.0.110.0050.00217.16
8.0.100.0070.00017.14
8.0.90.0000.00717.12
8.0.80.0040.00417.13
8.0.70.0000.00917.14
8.0.60.0050.00316.96
8.0.50.0040.00416.95
8.0.30.0050.00217.16
8.0.20.0040.00417.17
8.0.10.0000.00717.09
8.0.00.0080.00017.10
7.4.330.0030.00315.55
7.4.320.0030.00316.75
7.4.300.0000.00616.65
7.4.290.0040.00416.57
7.4.280.0030.00516.70
7.4.270.0000.00716.54
7.4.260.0000.00513.40
7.4.250.0030.00316.68
7.4.240.0030.00316.80
7.4.230.0050.00316.48
7.4.220.0000.00816.81
7.4.210.0040.00416.62
7.4.200.0040.00416.67
7.4.190.0070.00016.87
7.4.180.0030.00316.87
7.4.160.0040.00416.58
7.4.150.0000.00716.49
7.4.140.0040.00416.50
7.4.130.0000.00816.79
7.4.120.0030.00316.49
7.4.110.0000.00716.70
7.4.100.0040.00416.81
7.4.90.0080.00016.68
7.4.80.0030.00316.64
7.4.70.0000.00716.54
7.4.60.0070.00016.70
7.4.50.0000.00716.64
7.4.40.0030.00316.41
7.4.30.0070.00016.59
7.4.20.0000.00716.38
7.4.10.0030.00616.79
7.4.00.0030.00616.70
7.3.330.0000.00716.32
7.3.320.0030.00313.20
7.3.310.0050.00316.48
7.3.300.0050.00216.32
7.3.290.0070.00016.50
7.3.280.0000.00716.45
7.3.270.0030.00316.44
7.3.260.0030.00516.50
7.3.250.0060.00016.50
7.3.240.0040.00416.43
7.3.230.0020.00516.47
7.3.220.0000.00716.33
7.3.210.0000.00716.36
7.3.200.0020.00516.37
7.3.190.0000.00616.32
7.3.180.0070.00016.44
7.3.170.0070.00016.50
7.3.160.0000.00816.39
7.3.150.0050.00316.46
7.3.140.0050.00216.30
7.3.130.0040.00416.31
7.3.120.0020.00516.50
7.3.110.0040.00416.37
7.3.100.0040.00416.30
7.3.90.0050.00216.60
7.3.80.0000.00816.41
7.3.70.0050.00216.55
7.3.60.0070.00016.41
7.3.50.0000.00716.61
7.3.40.0040.00416.55
7.3.30.0070.00016.42
7.3.20.0110.00016.63
7.3.10.0000.00816.35
7.3.00.0000.00816.40

preferences:
101.02 ms | 1440 KiB | 5 Q