3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('a','b','c','d','x','u','xx'); $array2 = array('e','f','g','h','s','d','t'); $array3 = array('i','j','k','l'); $data = [$array1, $array2, $array3]; $newArray = array(); $mi = new MultipleIterator(MultipleIterator::MIT_NEED_ANY); $mi->attachIterator(new ArrayIterator($data[0])); $mi->attachIterator(new ArrayIterator($data[1])); $mi->attachIterator(new ArrayIterator($data[2])); foreach($mi as $details) { $newArray = array_merge( $newArray, array_filter($details) ); } var_dump($newArray);
Output for git.master, git.master_jit, rfc.property-hooks
array(18) { [0]=> string(1) "a" [1]=> string(1) "e" [2]=> string(1) "i" [3]=> string(1) "b" [4]=> string(1) "f" [5]=> string(1) "j" [6]=> string(1) "c" [7]=> string(1) "g" [8]=> string(1) "k" [9]=> string(1) "d" [10]=> string(1) "h" [11]=> string(1) "l" [12]=> string(1) "x" [13]=> string(1) "s" [14]=> string(1) "u" [15]=> string(1) "d" [16]=> string(2) "xx" [17]=> string(1) "t" }

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:
125.44 ms | 406 KiB | 5 Q