3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5, 'six' => 6 ]; $b = [ 'one' => 'uno', 'three' => 'tres', 'two' => 'dos', 'four' => 'cuatro', 'five' => 'cinco' ]; $result = []; foreach ($a as $k => $v) { $result[] = [$v, $b[$k] ?? null]; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 1, 1 => 'uno', ), 1 => array ( 0 => 2, 1 => 'dos', ), 2 => array ( 0 => 3, 1 => 'tres', ), 3 => array ( 0 => 4, 1 => 'cuatro', ), 4 => array ( 0 => 5, 1 => 'cinco', ), 5 => array ( 0 => 6, 1 => NULL, ), )

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.94 ms | 406 KiB | 5 Q