3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 1 => [ 1 => [ 'anna', 'alice' ], 2 => [ 'bob', 'bartold' ] ], 2 => [ 1 => [ 'carol' ], 2 => [ 'david' ] ] ]; $result = []; $currentIndex = 1; array_walk_recursive($result, function($value, $key) use (&$result, &$currentIndex)) { if (!is_array($value)) { $result[$currentIndex] = $value; $currentIndex++; } } var_dump($result);

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)
5.4.390.0100.05318.51
5.4.380.0170.06018.80
5.4.370.0230.04718.76
5.4.360.0230.04318.79
5.4.350.0230.06018.57
5.4.340.0230.04718.70
5.4.320.0170.06318.58
5.4.310.0130.06318.57
5.4.300.0100.06018.61
5.4.290.0130.07018.57
5.4.280.0200.07018.76
5.4.270.0300.05318.83
5.4.260.0070.06318.83
5.4.250.0300.06718.76
5.4.240.0170.08018.70
5.4.230.0230.07018.73
5.4.220.0200.07318.62
5.4.210.0130.05318.79
5.4.200.0130.05016.78
5.4.190.0070.06718.57
5.4.180.0270.04318.57
5.4.170.0130.05718.60
5.4.160.0270.06718.78
5.4.150.0130.07718.45
5.4.140.0200.06716.46
5.4.130.0100.05716.23
5.4.120.0100.05716.30
5.4.110.0130.05016.27
5.4.100.0270.05716.43
5.4.90.0200.07016.31
5.4.80.0130.07016.25
5.4.70.0100.08016.39
5.4.60.0230.06316.27
5.4.50.0070.07716.18
5.4.40.0300.06016.41
5.4.30.0200.06716.25
5.4.20.0270.06316.39
5.4.10.0230.06016.18
5.4.00.0130.07015.64
5.3.290.0170.08014.60
5.3.280.0230.06714.49
5.3.270.0170.08014.64
5.3.260.0370.05314.65
5.3.250.0100.05714.52
5.3.240.0130.06714.68
5.3.230.0230.05714.55
5.3.220.0170.06714.53
5.3.210.0200.06314.56
5.3.200.0130.05014.53
5.3.190.0100.07014.55
5.3.180.0200.04714.57
5.3.170.0170.05314.51
5.3.160.0130.06714.54
5.3.150.0200.04314.50
5.3.140.0130.06714.50
5.3.130.0100.06314.50
5.3.120.0300.05014.54
5.3.110.0100.07314.64
5.3.100.0170.05314.14
5.3.90.0130.05714.12
5.3.80.0130.05714.11
5.3.70.0170.06313.93
5.3.60.0170.06313.91
5.3.50.0170.06314.02
5.3.40.0170.05313.93
5.3.30.0000.06313.94
5.3.20.0200.04713.62
5.3.10.0130.05013.75
5.3.00.0170.04713.71
5.2.170.0170.05311.12
5.2.160.0170.05011.17
5.2.150.0130.05311.05
5.2.140.0200.04311.31
5.2.130.0100.04011.15
5.2.120.0130.04011.06
5.2.110.0100.04311.01
5.2.100.0270.03711.05
5.2.90.0130.05311.15
5.2.80.0100.05711.08
5.2.70.0100.04311.05
5.2.60.0100.05011.04
5.2.50.0130.05011.16
5.2.40.0230.03311.04
5.2.30.0100.04310.88
5.2.20.0200.04310.99
5.2.10.0200.03310.92
5.2.00.0100.05310.71
5.1.60.0030.05310.02
5.1.50.0030.0409.99
5.1.40.0070.0439.98
5.1.30.0170.03010.31
5.1.20.0170.03310.40
5.1.10.0100.03710.14
5.1.00.0070.03710.05
5.0.50.0130.0208.69
5.0.40.0070.0308.40
5.0.30.0100.0408.26
5.0.20.0070.0278.36
5.0.10.0070.0308.29
5.0.00.0030.0538.17
4.4.90.0070.0235.95
4.4.80.0100.0175.92
4.4.70.0100.0275.83
4.4.60.0100.0235.87
4.4.50.0070.0305.86
4.4.40.0030.0435.90
4.4.30.0000.0305.88
4.4.20.0000.0275.95
4.4.10.0000.0305.98
4.4.00.0030.0475.95
4.3.110.0000.0375.84
4.3.100.0030.0305.83
4.3.90.0130.0205.83
4.3.80.0030.0435.91
4.3.70.0070.0235.80
4.3.60.0070.0205.87
4.3.50.0070.0305.79
4.3.40.0030.0375.74
4.3.30.0030.0304.97
4.3.20.0070.0274.97
4.3.10.0030.0274.97
4.3.00.0170.01714.62

preferences:
141.03 ms | 1394 KiB | 7 Q