3v4l.org

run code in 300+ PHP versions simultaneously
<?php function append(array $init, array $add, $key = null) { $_init = $init; if (is_null($key)) $_init[] = $add; else $_init[$key] = $add; var_dump($init, $_init); return array_merge($_init, $init); } $a = [ 'phone' => [ 'code' => '+38', ], ]; $b = [ 'prefix' => '095', 'number' => '7700418', ]; var_dump(append($a, $b, 'phone'));
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["phone"]=> array(1) { ["code"]=> string(3) "+38" } } array(1) { ["phone"]=> array(2) { ["prefix"]=> string(3) "095" ["number"]=> string(7) "7700418" } } array(1) { ["phone"]=> array(1) { ["code"]=> string(3) "+38" } }

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