3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = [ 1031 => [ 'id' => '1031', 'name' => 'TR16', 'price' => 98.75 ], 1032 => [ 'id' => '1032', 'name' => 'TR16G', 'price' => 148.75 ] ]; $newItemIds = [ 1031 => [ 'id' => 1031, 'quantity' => 4 ], 1032 => [ 'id' => 1032, 'quantity' => 2 ] ]; $products_with_quantity = array_replace_recursive($products, $newItemIds); print_r($products_with_quantity);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [1031] => Array ( [id] => 1031 [name] => TR16 [price] => 98.75 [quantity] => 4 ) [1032] => Array ( [id] => 1032 [name] => TR16G [price] => 148.75 [quantity] => 2 ) )

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:
162.2 ms | 406 KiB | 5 Q