3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = '[{ "product_name": "Product1", "qty": "1" }, { "product_name": "Product2", "qty": "2" }, { "product_name": "Product3", "qty": "3" }]'; $array2 = '[{ "product_name": "Product4", "qty": "1" }, { "product_name": "Product3", "qty": "1" }, { "product_name": "Product2", "qty": "1" }]'; $arr1 = json_decode($array1, true); $arr2 = json_decode($array2, true); $result = array_merge($arr1,$arr2); var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'product_name' => 'Product1', 'qty' => '1', ), 1 => array ( 'product_name' => 'Product2', 'qty' => '2', ), 2 => array ( 'product_name' => 'Product3', 'qty' => '3', ), 3 => array ( 'product_name' => 'Product4', 'qty' => '1', ), 4 => array ( 'product_name' => 'Product3', 'qty' => '1', ), 5 => array ( 'product_name' => 'Product2', 'qty' => '1', ), )

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