3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_thingy(array $a, array $b) { $output = array(); while (count($a) > 0 || count($b) > 0) { if (count($a) > 0) { array_push($output, array_shift($a)); } if (count($b) > 0) { array_push($output, array_shift($b)); } } } $a = array( array( 'name' => 'Product 1', 'type' => 'p' ), array( 'name' => 'Product 2', 'type' => 'p' ) ); $b = array( array( 'name' => 'social 1', 'type' => 'f' ), array( 'name' => 'social 2', 'type' => 'f' ), array( 'name' => 'social 3', 'type' => 'f' ), array( 'name' => 'social 4', 'type' => 'f' ), array( 'name' => 'social 5', 'type' => 'f' ) ); var_dump(array_thingy($a, $b));
Output for git.master, git.master_jit, rfc.property-hooks
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:
49.97 ms | 401 KiB | 8 Q