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 += $keys; } var_export($items);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'Oranges' => array ( 'Name' => 'Oranges', 'l.VA123' => 17, 'l.MA123' => 12, 'l.GA123' => 9, 'l.CT123' => 5, 'l.CA123' => 0, 'l.WI123' => 0, 'l.FL123' => 0, ), 'Apple' => array ( 'Name' => 'Apple', 'l.CA123' => 13, 'l.VA123' => 0, 'l.MA123' => 0, 'l.GA123' => 0, 'l.CT123' => 0, 'l.WI123' => 0, 'l.FL123' => 0, ), 'Grapes' => array ( 'Name' => 'Grapes', 'l.WI123' => 8, 'l.FL123' => 5, 'l.VA123' => 0, 'l.MA123' => 0, 'l.GA123' => 0, 'l.CT123' => 0, 'l.CA123' => 0, ), )

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