3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $end = array( "id" => array("value_id_1,value_id_2,value_id_3"), "title"=> array("value_title_1,value_title_2,value_title_3"), "content"=>array("value_content_1,value_content_2,value_content_3") ); $iterator = 0; while ( $iterator < 2) { $api_arr["data"][] = array( "id" => $end["id"][$iterator], "title" => $end["title"][$iterator], "content" => $end["content"][$iterator] ); $iterator ++; } print_r($api_arr);
based on eeMGA
Output for 5.3.20 - 7.2.0
Notice: Undefined offset: 1 in /in/1dpjp on line 13 Notice: Undefined offset: 1 in /in/1dpjp on line 14 Notice: Undefined offset: 1 in /in/1dpjp on line 15 Array ( [data] => Array ( [0] => Array ( [id] => value_id_1,value_id_2,value_id_3 [title] => value_title_1,value_title_2,value_title_3 [content] => value_content_1,value_content_2,value_content_3 ) [1] => Array ( [id] => [title] => [content] => ) ) )