3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array('params' => array('height' => 100), 'oembed' => false); $expected = array('params' => array('width' => 500, 'height' => 100), 'oembed' => false, 'other' => '300'); var_dump(($expected === array_replace_recursive($a1, $a2))); $a1 = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array(); $expected = $a1; var_dump(($expected === array_replace_recursive($a1, $a2))); $a1 = array('params' =>array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array('params' =>array('width' => 100, 'stuff' => 888), 'oembed' => false); $expected = array('params' => array('width' => 100, 'height' => 200, 'stuff' => 888), 'oembed' => false, 'other' => '300'); var_dump(($expected === array_replace_recursive($a1, $a2))); $a1 = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array('params' => array(), 'oembed' => true); $expected = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); var_dump(($expected === array_replace_recursive($a1, $a2)));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(true) bool(true) bool(true)

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:
53.96 ms | 401 KiB | 8 Q