3v4l.org

run code in 200+ 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] . '<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.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.0
brown<br>white<br> brown dog white cat