3v4l.org

run code in 300+ PHP versions simultaneously
<?php $structure = [ "a", "b" => [ "b1", "b2" => [ "b21", "b22" ] ] ]; $data = ['A', 'B1', 'B21', 'B22']; $filled = 0; array_walk_recursive ($structure, function (&$val) { global $filled; global $data; $val = array( $val => $data[ $filled ] ); $filled++; }); print_r( $structure );
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [a] => A ) [b] => Array ( [0] => Array ( [b1] => B1 ) [b2] => Array ( [0] => Array ( [b21] => B21 ) [1] => Array ( [b22] => B22 ) ) ) )

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:
64.61 ms | 402 KiB | 8 Q