3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "id" => 2, "level" => 0, "email" => "bexcailimited1@gmail.com", ], [ [ "id" => 4, "level" => 1, "email" => "bexcailimited3@gmail.com", ], [ [ "id" => 5, "level" => 2, "email" => "bexcailimited4@gmail.com", ], [ [ "id" => 6, "level" => 3, "email" => "bexcailimited5@gmail.com", ], ], ], ], [ "id" => 3, "level" => 0, "email" => "bexcailimited2@gmail.com", ], [ "id" => 7, "level" => 0, "email" => "bexcaitest@gmail.com", ], [ [ "id" => 8, "level" => 1, "email" => "Test012@gmail.com", ], [ [ "id" => 9, "level" => 2, "email" => "test03@gmail.com", ], [ [ "id" => 10, "level" => 3, "email" => "test04@gmail.com", ], [ [ "id" => 11, "level" => 4, "email" => "test05@gmail.com", ], [ [ "id" => 12, "level" => 5, "email" => "test06@gmail.com", ], ], ], ], ], ], ]; function flattenList(array $array): array { $result = []; foreach ($array as $row) { array_push($result, ...array_is_list($row) ? flattenList($row) : [$row]); } return $result; } $flatten2d = flattenlist($array); usort($flatten2d, fn($a, $b) => $a['id'] <=> $b['id']); var_export($flatten2d);

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.4.120.0060.00220.45
8.4.110.0140.00620.59
8.4.100.0050.00417.94
8.4.90.0110.01117.93
8.4.80.0090.00817.69
8.4.70.0110.01217.86
8.4.60.0150.00417.90
8.4.50.0020.00618.80
8.4.40.0090.01317.45
8.4.30.0030.01318.82
8.4.20.0140.00719.62
8.4.10.0140.00319.58
8.3.250.0120.00720.60
8.3.240.0130.00616.64
8.3.230.0100.00916.66
8.3.220.0100.00817.16
8.3.210.0080.00716.63
8.3.200.0030.00416.62
8.3.190.0060.00317.27
8.3.180.0120.00620.78
8.3.170.0150.00318.78
8.3.160.0170.00316.82
8.3.150.0120.00816.53
8.3.140.0100.00716.79
8.3.130.0100.00017.25
8.3.120.0000.00820.60
8.3.110.0040.00420.94
8.3.100.0030.00616.62
8.3.90.0100.01026.77
8.3.80.0030.00617.97
8.3.70.0110.00416.50
8.3.60.0460.00925.92
8.3.50.0160.00325.92
8.3.40.0360.00925.92
8.3.30.0350.00825.92
8.3.20.0450.00425.92
8.3.10.0300.01725.92
8.3.00.0380.00625.92
8.2.290.0110.00820.35
8.2.280.0110.01016.79
8.2.270.0120.00916.79
8.2.260.0080.00017.30
8.2.250.0060.00316.36
8.2.240.0090.00317.41
8.2.230.0070.00422.58
8.2.220.0040.00424.06
8.2.210.0100.01026.77
8.2.200.0060.00316.50
8.2.190.0150.00316.70
8.2.180.0310.01425.92
8.2.170.0480.00625.92
8.2.160.0440.00425.92
8.2.150.0400.00725.92
8.2.140.0380.01325.92
8.2.130.0330.01525.92
8.2.120.0420.00725.92
8.2.110.0370.01225.92
8.2.100.0400.00625.92
8.2.90.0290.01125.92
8.2.80.0290.01625.92
8.2.70.0380.00825.92
8.2.60.0440.00725.92
8.2.50.0420.00625.92
8.2.40.0340.00925.92
8.2.30.0320.01125.92
8.2.20.0350.00725.92
8.2.10.0400.00325.92
8.2.00.0270.01625.92
8.1.330.0130.00717.05
8.1.320.0120.00816.10
8.1.310.0040.01116.97
8.1.300.0060.00317.77
8.1.290.0060.00330.84
8.1.280.0420.01025.92
8.1.270.0350.01625.92
8.1.260.0300.01525.92
8.1.250.0240.02425.92
8.1.240.0310.01225.92
8.1.230.0400.00825.92
8.1.220.0430.00825.92
8.1.210.0400.00625.92
8.1.200.0330.00925.92
8.1.190.0260.01325.92
8.1.180.0290.01325.92
8.1.170.0320.00925.92
8.1.160.0330.00325.92
8.1.150.0320.00725.92
8.1.140.0320.01025.92
8.1.130.0400.00625.92
8.1.120.0310.01425.92
8.1.110.0330.01325.92
8.1.100.0370.00025.92
8.1.90.0390.00025.92
8.1.80.0280.00925.92
8.1.70.0420.00625.92
8.1.60.0300.01325.92
8.1.50.0330.01525.92
8.1.40.0310.01525.92
8.1.30.0320.01525.92
8.1.20.0370.01025.92
8.1.10.0420.00625.92
8.1.00.0490.00325.92

preferences:
49.98 ms | 403 KiB | 5 Q