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 usort($dataset, fn (array $playerA, array $playerB): int => ($playerA['money'] > $playerB['money'] ? -1 : 1) * ['desc' => 1, 'asc' => -1][$order] ?? -1); // Print results var_dump($dataset);

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.00920.07
8.5.20.0080.00919.95
8.5.10.0090.00818.74
8.5.00.0100.01020.02
8.4.180.0150.00719.57
8.4.170.0160.00821.94
8.4.160.0050.00522.10
8.4.150.0010.00114.05
8.4.140.0120.00917.57
8.4.130.0110.01017.73
8.4.120.0090.00620.74
8.4.110.0040.00519.07
8.4.100.0110.00917.83
8.4.90.0100.01117.92
8.4.80.0030.00617.71
8.4.70.0100.00618.04
8.4.60.0140.00718.68
8.4.50.0100.01117.72
8.4.40.0070.00419.52
8.4.30.0180.00020.49
8.4.20.0170.00317.73
8.4.10.0000.00920.40
8.3.300.0150.00518.45
8.3.290.0060.00420.95
8.3.280.0050.00718.70
8.3.270.0120.00716.48
8.3.260.0100.00716.50
8.3.250.0090.00418.73
8.3.240.0100.00916.56
8.3.230.0150.00416.73
8.3.220.0090.01016.70
8.3.210.0060.00916.84
8.3.200.0050.00416.66
8.3.190.0140.00417.11
8.3.180.0110.00716.56
8.3.170.0100.01016.64
8.3.160.0070.01118.75
8.3.150.0080.00817.35
8.3.140.0000.00916.47
8.3.130.0090.00016.63
8.3.120.0060.00318.89
8.3.110.0060.00320.94
8.3.100.0030.00716.48
8.3.90.0000.00926.77
8.3.80.0000.00916.50
8.3.70.0060.00916.75
8.3.60.0140.00716.63
8.3.50.0180.00418.39
8.3.40.0120.00319.09
8.3.30.0140.00019.21
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.300.0120.00822.00
8.2.290.0150.00418.91
8.2.280.0040.00520.36
8.2.270.0130.00716.94
8.2.260.0100.01016.93
8.2.250.0060.01018.34
8.2.240.0120.00619.14
8.2.230.0080.00022.58
8.2.220.0060.00924.06
8.2.210.0000.00826.77
8.2.200.0090.00016.38
8.2.190.0110.00716.58
8.2.180.0060.01225.92
8.2.170.0140.00719.09
8.2.160.0140.00022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0060.00320.39
8.2.100.0070.00320.39
8.1.340.0100.01119.61
8.1.330.0110.00915.95
8.1.320.0080.01116.07
8.1.310.0020.00518.62
8.1.300.0060.00318.43
8.1.290.0090.00030.84
8.1.280.0090.00925.92
8.1.270.0020.00523.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00318.58
8.1.230.0030.00618.92
8.1.00.0050.00317.41

preferences:
58.93 ms | 881 KiB | 5 Q