3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pet1 = 'dog'; $pet2 = 'cat'; $arrayvalue = array( array('brown', 'white'), array($pet1, $pet2) ); // echo both parts: for ($i=0; $i<2; $i++) echo $arrayvalue[0][$i] . ' ' . $arrayvalue[1][$i] . '<br>'; echo "\n"; //echo just the first part: echo $arrayvalue[0][0] . ' ' . $arrayvalue[1][0]; echo "\n"; //echo just the second part: echo $arrayvalue[0][1] . ' ' . $arrayvalue[1][1];
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
brown dog<br>white cat<br> brown dog white cat