3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = Array ( 'Oranges' => Array ( 'Name' => 'Oranges', 'l.VA123' => 17, 'l.MA123' => 12, 'l.GA123' => 9, 'l.CT123' => 5, ), 'Apple' => Array ( 'Name' => 'Apple', 'l.CA123' => 13, ), 'Grapes' => Array ( 'Name' => 'Grapes', 'l.WI123' => 8, 'l.FL123' => 5, ), ); // known keys $keys = [ 'l.VA123' => 0, 'l.MA123' => 0, 'l.GA123' => 0, 'l.CT123' => 0, 'l.CA123' => 0, 'l.WI123' => 0, 'l.FL123' => 0, ]; foreach ($items as &$row) { $row = array_replace($keys, $row); } var_export($items);
Output for git.master_jit, git.master, rfc.property-hooks
array ( 'Oranges' => array ( 'l.VA123' => 17, 'l.MA123' => 12, 'l.GA123' => 9, 'l.CT123' => 5, 'l.CA123' => 0, 'l.WI123' => 0, 'l.FL123' => 0, 'Name' => 'Oranges', ), 'Apple' => array ( 'l.VA123' => 0, 'l.MA123' => 0, 'l.GA123' => 0, 'l.CT123' => 0, 'l.CA123' => 13, 'l.WI123' => 0, 'l.FL123' => 0, 'Name' => 'Apple', ), 'Grapes' => array ( 'l.VA123' => 0, 'l.MA123' => 0, 'l.GA123' => 0, 'l.CT123' => 0, 'l.CA123' => 0, 'l.WI123' => 8, 'l.FL123' => 5, 'Name' => 'Grapes', ), )

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:
132.19 ms | 407 KiB | 5 Q