3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! $x = array ( 4 => array ( "locationIds" => array ( '1' ), "contentIds" => array ( '2' ) ), 2 => array ( "locationIds" => array ( '3' ), "contentIds" => array ( 4 ) ) ); foreach( $x as $i => $v ) //echo $i . ' => ' . $v . "\n"; print_r( $v );
Output for 4.3.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [locationIds] => Array ( [0] => 1 ) [contentIds] => Array ( [0] => 2 ) ) Array ( [locationIds] => Array ( [0] => 3 ) [contentIds] => Array ( [0] => 4 ) )