3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "hero" => [ "name" => "Peter", "job" => "Spider Man" ], "dog" => [ "age" => 5, "toys" => [ "first" => "bone", "second" => "ball" ] ] ]; //values to update $toUpdate = [ "hero" => [ "name" => "Peter Parker", "age" => 26 ], "dog" => [ "name" => "Rex", "toys" => [ "second" => "frisbee" ] ] ]; var_export(array_replace_recursive($array, $toUpdate));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'hero' => array ( 'name' => 'Peter Parker', 'job' => 'Spider Man', 'age' => 26, ), 'dog' => array ( 'age' => 5, 'toys' => array ( 'first' => 'bone', 'second' => 'frisbee', ), 'name' => 'Rex', ), )

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