3v4l.org

run code in 300+ PHP versions simultaneously
<?php function partial(callable $callable, ...$initialargs): callable { return fn (...$args) => $callable(...$initialargs, ...$args); } $data = [ [ 'quiz' => 2, 'question' => 7, 'notif' => 'sup' ], [ 'quiz' => 3, 'question' => 7, 'notif' => 'pus' ], [ 'quiz' => 2, 'question' => 3, 'notif' => 'yoyoyo' ] ]; $keys = fn(array $data, string $key): callable => partial(array_keys(...), array_column($data, $key)); $indices = fn(array $data, string $key): array => array_map($keys($data, $key), array_column($data, $key, $key)); $map = fn(array $data): callable => partial(array_map(...), fn(int $i): array => $data[$i]); $byx = fn(array $data, string $x): array => array_map($map, $indices($data, $x)); $byquiz = $byx($data, 'quiz'); $byquizandquestion = array_map(fn($d) => $byx($d, 'question'), $byquiz); print_r($byquizandquestion);

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.20.0070.01319.68
8.4.10.0060.00619.48
8.3.150.0120.00617.09
8.3.140.0090.00016.79
8.3.130.0030.00616.75
8.3.120.0350.00716.51
8.3.110.0360.00716.49
8.3.100.0360.00616.18
8.3.90.0310.00916.57
8.3.80.0360.00716.42
8.3.70.0470.00016.54
8.3.60.0420.00716.67
8.3.50.0300.01116.37
8.3.40.0230.01917.49
8.3.30.0260.01517.43
8.3.20.0210.01417.54
8.3.10.0270.01017.21
8.3.00.0180.00919.32
8.2.260.0090.00617.09
8.2.250.0110.00416.57
8.2.240.0310.00816.54
8.2.230.0380.00316.32
8.2.220.0320.01016.44
8.2.210.0160.00816.25
8.2.200.0260.00316.36
8.2.190.0320.00516.46
8.2.180.0280.01116.53
8.2.170.0270.01317.75
8.2.160.0200.01717.69
8.2.150.0320.00817.62
8.2.140.0270.00017.43
8.2.130.0160.00417.56
8.2.120.0200.00017.72
8.2.110.0180.01417.26
8.2.100.0310.00317.60
8.2.90.0310.00317.71
8.2.80.0330.00717.43
8.2.70.0310.00317.60
8.2.60.0280.00617.54
8.2.50.0270.01017.35
8.2.40.0320.00917.39
8.2.30.0340.01417.42
8.2.20.0290.01117.27
8.2.10.0290.01017.43
8.2.00.0190.01917.58
8.1.310.0070.01018.10
8.1.300.0210.01416.32
8.1.290.0280.01116.36
8.1.280.0320.00916.20
8.1.270.0390.00417.28
8.1.260.0380.00317.31
8.1.250.0320.01117.24
8.1.240.0350.00317.06
8.1.230.0170.01717.32
8.1.220.0310.01017.31
8.1.210.0290.01617.36
8.1.200.0300.00717.06
8.1.190.0310.00717.05
8.1.180.0250.01417.09
8.1.170.0220.01117.29
8.1.160.0280.00817.25
8.1.150.0240.01317.14
8.1.140.0260.01117.20
8.1.130.0300.00717.16
8.1.120.0240.01417.37
8.1.110.0260.01117.00
8.1.100.0370.00017.13
8.1.90.0250.01217.32
8.1.80.0250.01217.29
8.1.70.0370.00017.32
8.1.60.0370.00417.39
8.1.50.0380.00317.29
8.1.40.0330.00717.34
8.1.30.0460.00317.26
8.1.20.0370.00317.43
8.1.10.0300.01117.27
8.1.00.0420.00017.13

preferences:
40.02 ms | 403 KiB | 5 Q