3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $newdata = array ( 'wpseo_title' => 'test1', 'wpseo_desc' => 'test2', 'wpseo_metakey' => 'test3' ); $count=0; $count2=100; foreach ($newdata as $key => $newdat) { $count++; $count2++; echo $newdat;echo $count; array_push($newdata, $count); array_push($newdata, $count2); } var_dump($newdata); // for recipe $md_array["recipe_type"][] = $newdata; //for cuisine $md_array["cuisine"][] = $newdata; array_push($md_array["cuisine"],$newdata); //var_dump($md_array["cuisine"]); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
test11test22test33array(9) { ["wpseo_title"]=> string(5) "test1" ["wpseo_desc"]=> string(5) "test2" ["wpseo_metakey"]=> string(5) "test3" [0]=> int(1) [1]=> int(101) [2]=> int(2) [3]=> int(102) [4]=> int(3) [5]=> int(103) }