3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sizes = json_decode('{"0":{"size_id":5,"it":"50","us":"32"},"1":{"size_id":4,"it":"48","us":"30"}}', true); $percentages = json_decode('[{"5":"70"},{"4":"30"}]', true); $final = []; foreach($sizes AS $size) { $final[$size['size_id']] = $size; } foreach($percentages AS $percentage) { $final[key($percentage)]['percentage'] = current($percentage); } $final = array_values($final); print_r($final); echo json_encode($final);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [size_id] => 5 [it] => 50 [us] => 32 [percentage] => 70 ) [1] => Array ( [size_id] => 4 [it] => 48 [us] => 30 [percentage] => 30 ) ) [{"size_id":5,"it":"50","us":"32","percentage":"70"},{"size_id":4,"it":"48","us":"30","percentage":"30"}]

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