3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $that = array(); $that[] = array(3, "cat"); $that[] = array(1, "dog"); $empty = array(); foreach ($that as $word) { $empty = $empty + array_fill(count($empty), $word[0], $word[1]); } var_dump($empty);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(4) { [0]=> string(3) "cat" [1]=> string(3) "cat" [2]=> string(3) "cat" [3]=> string(3) "dog" }