3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Raw data $json = <<<'JSON' { "player1": { "money": 1000, "kills": 6 }, "player2": { "money": 3000, "kills": 12 }, "player3": { "money": 2000, "kills": 2 } } JSON; // Prepare $sortBy = 'money'; $order = 'desc'; $dataset = json_decode($json, true); // Sorting uasort($dataset, fn (array $playerA, array $playerB): int => ($playerA['money'] > $playerB['money'] ? -1 : 1) * ['desc' => 1, 'asc' => -1][$order] ?? -1); // Print results var_dump($dataset); $i = 1; foreach($dataset as $player => $data) { echo "#$i: $player (\${$data['money']})" . PHP_EOL; $i ++; }

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.0040.00320.11
8.5.20.0100.00820.18
8.5.10.0080.00918.75
8.5.00.0090.01120.18
8.4.180.0160.00721.23
8.4.170.0140.00819.55
8.4.160.0130.00923.10
8.4.150.0020.00114.05
8.4.140.0120.00917.38
8.4.130.0120.00717.89
8.4.120.0120.00920.66
8.4.110.0060.00722.52
8.4.100.0110.01017.92
8.4.90.0060.00218.56
8.4.80.0120.00817.69
8.4.70.0120.00517.97
8.4.60.0160.00518.85
8.4.50.0060.00220.21
8.4.40.0040.01219.52
8.4.30.0120.00820.16
8.4.20.0100.01020.79
8.4.10.0120.00824.24
8.3.300.0120.00920.38
8.3.290.0110.00820.97
8.3.280.0090.01118.40
8.3.270.0150.00916.21
8.3.260.0110.00916.53
8.3.250.0120.00719.02
8.3.240.0070.00116.64
8.3.230.0130.00716.58
8.3.220.0060.00217.26
8.3.210.0070.00118.48
8.3.200.0070.00216.63
8.3.190.0100.00817.03
8.3.180.0110.00816.56
8.3.170.0090.00917.13
8.3.160.0070.00718.31
8.3.150.0130.00618.92
8.3.140.0030.00617.34
8.3.130.0040.00418.43
8.3.120.0050.00518.27
8.3.110.0070.01016.50
8.3.100.0050.00316.61
8.3.90.0040.00426.77
8.3.80.0050.00516.63
8.3.70.0160.00016.58
8.3.60.0120.00916.63
8.3.50.0110.00720.02
8.3.40.0100.01020.30
8.3.30.0090.00618.91
8.3.20.0070.00024.18
8.3.10.0050.00324.66
8.3.00.0060.00326.16
8.2.300.0070.01320.29
8.2.290.0120.00720.48
8.2.280.0040.00518.38
8.2.270.0090.00917.54
8.2.260.0040.01516.84
8.2.250.0040.00416.91
8.2.240.0110.00817.42
8.2.230.0080.00020.94
8.2.220.0080.00024.06
8.2.210.0040.00426.77
8.2.200.0030.00716.63
8.2.190.0150.00316.88
8.2.180.0100.01025.92
8.2.170.0100.01018.96
8.2.160.0110.00422.96
8.2.150.0030.00625.66
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00018.90
8.2.110.0000.00920.19
8.2.100.0070.00320.38
8.1.340.0090.01017.53
8.1.330.0130.00621.86
8.1.320.0040.00416.21
8.1.310.0080.00016.72
8.1.300.0000.00918.30
8.1.290.0030.00630.84
8.1.280.0120.00625.92
8.1.270.0040.00423.99
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0040.00718.81
8.1.230.0110.00020.45
8.1.00.0050.00417.32

preferences:
31.4 ms | 887 KiB | 5 Q