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']);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'basic', 1 => 'small', 2 => 'novice', 3 => 'professional', 4 => 'master', 5 => 'promo', 6 => 'newplan', ) --or-- array ( 0 => 'basic', 1 => 'small', 2 => 'novice', 3 => 'professional', 4 => 'master', 5 => 'promo', 6 => 'newplan', ) --or-- array ( 0 => 'basic', 1 => 'small', 2 => 'novice', 3 => 'professional', 4 => 'master', 5 => 'promo', 6 => 'newplan', ) --or-- array ( 0 => 'basic', 1 => 'small', 2 => 'novice', 3 => 'professional', 4 => 'master', 5 => 'promo', 6 => 'newplan', )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.67 ms | 402 KiB | 8 Q