3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ ['plan' => 'basic'], ['plan' => 'small'], ['plan' => 'novice'], ['plan' => 'professional'], ['plan' => 'master'], ['plan' => 'promo'], ['plan' => 'newplan'] ] ]; // var_export($array); array_walk_recursive($array, function($leafvalue)use(&$flat1){$flat1[] = $leafvalue;}); var_export($flat1); echo "\n--or--\n"; var_export(array_column($array[0], 'plan')); echo "\n--or--\n"; foreach ($array[0] as $plans) { foreach ($plans as $value) { $flat2[] = $value; } } var_export($flat2); echo "\n--or--\n"; var_export(array_merge_recursive(...$array[0])['plan']);

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.3.40.0120.00418.66
8.3.30.0120.00318.64
8.3.20.0080.00019.29
8.3.10.0070.00021.94
8.3.00.0000.00720.72
8.2.170.0090.00918.91
8.2.160.0000.01422.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00020.08
8.2.110.0100.00019.45
8.2.100.0080.00617.91
8.2.90.0000.00817.97
8.2.80.0060.00319.11
8.2.70.0080.00017.50
8.2.60.0040.00418.03
8.2.50.0030.00518.07
8.2.40.0080.00018.16
8.2.30.0000.00918.09
8.2.20.0030.00618.12
8.2.10.0030.00618.18
8.2.00.0030.00517.82
8.1.270.0000.00824.66
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00022.19
8.1.230.0080.00321.04
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0080.00018.10
8.1.170.0040.00418.64
8.1.160.0040.00718.93
8.1.150.0040.00418.85
8.1.140.0000.00722.09
8.1.130.0000.00817.53
8.1.120.0070.00317.50
8.1.110.0000.00817.47
8.1.100.0040.00417.47
8.1.90.0000.00717.47
8.1.80.0040.00417.36
8.1.70.0040.00417.39
8.1.60.0080.00017.61
8.1.50.0050.00317.57
8.1.40.0050.00617.57
8.1.30.0130.00017.60
8.1.20.0110.00217.59
8.1.10.0090.00717.53
8.1.00.0120.00517.49
8.0.300.0020.00520.20
8.0.290.0000.00716.75
8.0.280.0030.00620.14
8.0.270.0050.00516.85
8.0.260.0030.00316.91
8.0.250.0040.00317.02
8.0.240.0040.00416.98
8.0.230.0070.00016.85
8.0.220.0000.00816.81
8.0.210.0000.00716.80
8.0.200.0000.00717.00
8.0.190.0040.00416.96
8.0.180.0000.00916.99
8.0.170.0120.00216.91
8.0.160.0060.00716.86
8.0.150.0090.00416.84
8.0.140.0080.00516.75
8.0.130.0070.00515.08
8.0.120.0060.00716.89
8.0.110.0100.00316.84
8.0.100.0050.00816.85
8.0.90.0120.00216.96
8.0.80.0080.00816.88
8.0.70.0080.00616.81
8.0.60.0070.00616.91
8.0.50.0110.00216.79
8.0.30.0110.00616.96
8.0.20.0090.01017.24
8.0.10.0080.00516.87
8.0.00.0120.00616.91
7.4.330.0030.00315.55
7.4.320.0000.00616.54
7.4.300.0070.00016.62
7.4.290.0000.00716.47
7.4.280.0120.00316.58
7.4.270.0090.00616.54
7.4.260.0130.00216.48
7.4.250.0070.00516.52
7.4.240.0130.00116.63
7.4.230.0100.00116.66
7.4.220.0100.00416.50
7.4.210.0100.00916.55
7.4.200.0070.00616.67
7.4.190.0190.00016.60
7.4.180.0150.00416.52
7.4.160.0110.00616.62
7.4.150.0150.00316.34
7.4.140.0140.01117.58
7.4.130.0120.00516.55
7.4.120.0110.00816.56
7.4.110.0120.00916.31
7.4.100.0170.00716.51
7.4.90.0130.01116.47
7.4.80.0170.00817.47
7.4.70.0170.00716.53
7.4.60.0140.00716.55
7.4.50.0110.00816.43
7.4.40.0090.01016.39
7.4.30.0130.00616.49
7.4.20.0160.00816.37
7.4.10.0140.00916.45
7.4.00.0090.00916.21
7.3.330.0060.00614.64
7.3.320.0080.00514.73
7.3.310.0090.00516.42
7.3.300.0060.00616.32
7.3.290.0110.00216.31
7.3.280.0110.00616.27
7.3.270.0190.00016.40
7.3.260.0120.00716.50
7.3.250.0130.00716.39
7.3.240.0120.00716.44
7.3.230.0110.00916.44
7.3.220.0220.00716.33
7.3.210.0180.00816.40
7.3.200.0140.01116.39
7.3.190.0180.00716.50
7.3.180.0140.00916.27
7.3.170.0140.00816.30
7.3.160.0160.00716.48
7.3.150.0160.00916.40
7.3.140.0110.01116.34
7.3.130.0130.00816.46
7.3.120.0150.00716.29
7.3.110.0140.00615.94
7.3.100.0100.00815.67
7.3.90.0120.00715.84
7.3.80.0090.00815.77
7.3.70.0090.00715.77
7.3.60.0120.00515.70
7.3.50.0080.01015.78
7.3.40.0070.01215.78
7.3.30.0080.00915.72
7.3.20.0110.00616.23
7.3.10.0100.00816.13
7.3.00.0110.01116.13
7.2.340.0180.00216.45
7.2.330.0170.00816.49
7.2.320.0130.01416.63
7.2.310.0150.00916.50
7.2.300.0140.00816.55
7.2.290.0110.01116.56
7.2.280.0150.00816.53
7.2.270.0150.00816.62
7.2.260.0140.00716.50
7.2.250.0120.00916.53
7.2.240.0120.00816.03
7.2.230.0110.00815.87
7.2.220.0110.01015.94
7.2.210.0120.00615.83
7.2.200.0070.01015.91
7.2.190.0100.00815.89
7.2.180.0100.00815.95
7.2.170.0140.00315.95
7.2.160.0090.00816.02
7.2.150.0090.00916.41
7.2.140.0100.00916.31
7.2.130.0230.01016.23
7.2.120.0120.00716.72
7.2.110.0230.00916.42
7.2.100.0190.00916.38
7.2.90.0260.00516.36
7.2.80.0320.00616.37
7.2.70.0280.00816.50
7.2.60.0250.00616.34
7.2.50.0210.00716.41
7.2.40.0200.00816.47
7.2.30.0230.00716.55
7.2.20.0230.00716.40
7.2.10.0240.00816.47
7.2.00.0220.00816.51
7.1.330.0190.00615.62
7.1.320.0140.00915.28
7.1.310.0190.00615.30
7.1.300.0140.00715.32
7.1.290.0160.00615.26
7.1.280.0130.00715.31
7.1.270.0130.00615.30
7.1.260.0100.00915.17
7.1.250.0200.00715.72
7.1.240.0150.00715.57
7.1.230.0280.00815.31
7.1.220.0220.00815.35
7.1.210.0340.00815.39
7.1.200.0250.00715.29
7.1.190.0240.00815.30
7.1.180.0250.00815.35
7.1.170.0290.00615.29
7.1.160.0220.00815.36
7.1.150.0270.00615.36
7.1.140.0230.00715.44
7.1.130.0250.00715.40
7.1.120.0290.00715.34
7.1.110.0250.00815.45
7.1.100.0220.00715.39
7.1.90.0230.00715.41
7.1.80.0230.00715.39
7.1.70.0230.00715.35
7.1.60.0220.01017.92
7.1.50.0260.00717.92
7.1.40.0260.00717.92
7.1.30.0250.00817.87
7.1.20.0250.00817.87
7.1.10.0270.00915.34
7.1.00.0230.00815.28
7.0.330.0160.00815.28
7.0.320.0230.00215.88
7.0.310.0170.00815.88
7.0.300.0290.00615.80
7.0.290.0220.00415.91
7.0.280.0220.00615.78
7.0.270.0160.00815.84
7.0.260.0190.00615.82
7.0.250.0200.00815.93
7.0.240.0170.00815.84
7.0.230.0200.00415.99
7.0.220.0210.00415.87
7.0.210.0180.00615.96
7.0.200.0170.00615.88
7.0.190.0190.00915.93
7.0.180.0180.00715.78
7.0.170.0210.00715.88
7.0.160.0160.00715.77
7.0.150.0170.00715.89
7.0.140.0180.00715.81
7.0.130.0160.01015.90
7.0.120.0180.00615.99
7.0.110.0180.00515.74
7.0.100.0220.00615.87
7.0.90.0220.00415.82
7.0.80.0190.01015.84
7.0.70.0170.01015.81
7.0.60.0180.00915.84
7.0.50.0170.00915.76
7.0.40.0180.00615.80
7.0.30.0170.00715.85
7.0.20.0220.00515.87
7.0.10.0190.00515.92
7.0.00.0150.00815.92
5.6.400.0140.00815.26
5.6.390.0160.00815.27
5.6.380.0140.00714.96
5.6.370.0170.01015.85
5.6.360.0170.01015.92
5.6.350.0180.00715.89
5.6.340.0180.00915.71
5.6.330.0160.00816.05
5.6.320.0190.00715.83
5.6.310.0210.00415.88
5.6.300.0210.00615.77
5.6.290.0190.00816.11
5.6.280.0190.00815.85
5.6.270.0180.00715.96
5.6.260.0120.01215.97
5.6.250.0160.00816.00
5.6.240.0150.01015.87
5.6.230.0150.01316.01
5.6.220.0170.01116.01
5.6.210.0200.00815.95
5.6.200.0180.00815.99
5.6.190.0210.00415.96
5.6.180.0180.00916.10
5.6.170.0180.00616.02
5.6.160.0190.00716.01
5.6.150.0190.00715.93
5.6.140.0200.00716.09
5.6.130.0180.00715.98
5.6.120.0180.00715.92
5.6.110.0190.00815.95
5.6.100.0220.00916.05
5.6.90.0200.00516.04
5.6.80.0210.00515.71
5.6.70.0150.01015.88
5.6.60.0180.00715.96
5.6.50.0180.00915.86
5.6.40.0140.01015.75
5.6.30.0150.01015.98
5.6.20.0140.01215.92
5.6.10.0150.01015.98
5.6.00.0190.00715.78

preferences:
52.8 ms | 400 KiB | 5 Q