3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'product1' => [ 'id' => 1, 'title' => 'p1', 'extra' => [ 'date' => '1990-02-04 16:40:26' ] ], 'product2' => [ 'id' => 2, 'title' => 'p2', 'extra' => [ 'date' => '1980-01-04 16:40:26' ] ], 'product3' => [ 'id' => 3, 'title' => 'p3', 'extra' => [ 'date' => '2000-01-04 16:40:26' ] ], 'product4' => [ 'id' => 4, 'title' => 'p4', 'extra' => [ 'date' => '1995-01-04 16:40:26' ] ], 'product5' => [ 'id' => 5, 'title' => 'p5', 'extra' => [ 'date' => '1960-01-04 16:40:26' ] ] ]; $cache = $array; uasort($array, fn($a, $b) => $b['extra']['date'] <=> $a['extra']['date']); var_export(array_slice($array, 0, 2) + $cache);

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.0080.00918.11
8.5.20.0100.00719.48
8.5.10.0100.01016.89
8.5.00.0120.00820.13
8.4.180.0140.01219.65
8.4.170.0140.00920.44
8.4.160.0100.01220.60
8.4.150.0080.00516.81
8.4.140.0100.01117.77
8.4.130.0040.00619.29
8.4.120.0050.00520.41
8.4.110.0110.00918.75
8.4.100.0130.00717.71
8.4.90.0140.00818.10
8.4.80.0080.01317.73
8.4.70.0130.00717.96
8.4.60.0120.00918.66
8.4.50.0050.00417.67
8.4.40.0350.01317.34
8.4.30.0320.01417.52
8.4.20.0420.00717.63
8.4.10.0320.01617.31
8.3.300.0090.01020.84
8.3.290.0050.00420.86
8.3.280.0060.00516.26
8.3.270.0100.00916.67
8.3.260.0100.00616.58
8.3.250.0060.00219.05
8.3.240.0130.00616.63
8.3.230.0040.00416.65
8.3.220.0120.00717.36
8.3.210.0090.01016.64
8.3.200.0050.00416.47
8.3.190.0110.00816.41
8.3.180.0050.00316.73
8.3.170.0310.01316.23
8.3.160.0400.00616.25
8.3.150.0420.00416.13
8.3.140.0300.01516.82
8.3.130.0250.00816.47
8.3.120.0280.00916.41
8.3.110.0330.00716.27
8.3.100.0370.01116.29
8.3.90.0370.01416.69
8.3.80.0320.01316.40
8.3.70.0350.01016.49
8.3.60.0410.00416.32
8.3.50.0370.00716.48
8.3.40.0250.01117.34
8.3.30.0270.00917.64
8.3.20.0260.01317.18
8.3.10.0300.00717.50
8.3.00.0150.00917.57
8.2.300.0150.00620.43
8.2.290.0070.00220.44
8.2.280.0090.01018.46
8.2.270.0240.01716.81
8.2.260.0340.00916.61
8.2.250.0290.00816.30
8.2.240.0380.00016.50
8.2.230.0270.01216.43
8.2.220.0310.00616.19
8.2.210.0350.00416.65
8.2.200.0280.01016.59
8.2.190.0180.01416.55
8.2.180.0350.00316.39
8.2.170.0400.00717.73
8.2.160.0320.00417.76
8.2.150.0300.01217.60
8.2.140.0310.00717.57
8.2.130.0300.01017.39
8.2.120.0350.00617.64
8.2.110.0320.01317.54
8.2.100.0310.00317.60
8.2.90.0380.00717.81
8.2.80.0420.00617.41
8.2.70.0310.00817.65
8.2.60.0300.00617.68
8.2.50.0270.01217.63
8.2.40.0310.00617.56
8.2.30.0310.00617.75
8.2.20.0220.01117.57
8.2.10.0200.00917.58
8.2.00.0260.01117.54
8.1.340.0080.01220.23
8.1.320.0120.00815.98

preferences:
42.68 ms | 907 KiB | 5 Q