3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ ['ID' => 1], ['ID' => 2], ['ID' => 3], ['ID' => 4], ['ID' => 5], ]; $array2 = [ ['ID' => 2, 'NUM' => 200], ['ID' => 4, 'NUM' => 400], ]; foreach ($array1 as ['ID' => $id, 'NUM' => &$ref[$id]]) { $ref[$id] = 0; } foreach ($array2 as ['ID' => $id, 'NUM' => $ref[$id]]); var_export($array1);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'ID' => 1, 'NUM' => 0, ), 1 => array ( 'ID' => 2, 'NUM' => 200, ), 2 => array ( 'ID' => 3, 'NUM' => 0, ), 3 => array ( 'ID' => 4, 'NUM' => 400, ), 4 => array ( 'ID' => 5, 'NUM' => 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:
24.39 ms | 406 KiB | 5 Q