3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "<h1>Manual access to each element</h1>"; echo $shop[0][0]." costs ".$shop[0][1]." and you get ".$shop[0][2]."<br />"; echo $shop[1][0]." costs ".$shop[1][1]." and you get ".$shop[1][2]."<br />"; echo $shop[2][0]." costs ".$shop[2][1]." and you get ".$shop[2][2]."<br />"; echo "<h1>Using loops to display array elements</h1>"; echo "<ol>"; for ($row = 0; $row < 3; $row++) { echo "<li><b>The row number $row</b>"; echo "<ul>"; for ($col = 0; $col < 3; $col++) { echo "<li>".$shop[$row][$col]."</li>"; } echo "</ul>"; echo "</li>"; } echo "</ol>";
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
<h1>Manual access to each element</h1> Notice: Undefined variable: shop in /in/0H7Iv on line 4 Notice: Undefined variable: shop in /in/0H7Iv on line 4 Notice: Undefined variable: shop in /in/0H7Iv on line 4 costs and you get <br /> Notice: Undefined variable: shop in /in/0H7Iv on line 5 Notice: Undefined variable: shop in /in/0H7Iv on line 5 Notice: Undefined variable: shop in /in/0H7Iv on line 5 costs and you get <br /> Notice: Undefined variable: shop in /in/0H7Iv on line 6 Notice: Undefined variable: shop in /in/0H7Iv on line 6 Notice: Undefined variable: shop in /in/0H7Iv on line 6 costs and you get <br /><h1>Using loops to display array elements</h1><ol><li><b>The row number 0</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li><li><b>The row number 1</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li><li><b>The row number 2</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li></ol>
Output for hhvm-3.12.0
<h1>Manual access to each element</h1> Notice: Undefined variable: shop in /in/0H7Iv on line 4 Notice: Undefined variable: shop in /in/0H7Iv on line 4 Notice: Undefined variable: shop in /in/0H7Iv on line 4 costs and you get <br /> Notice: Undefined variable: shop in /in/0H7Iv on line 5 Notice: Undefined variable: shop in /in/0H7Iv on line 5 Notice: Undefined variable: shop in /in/0H7Iv on line 5 costs and you get <br /> Notice: Undefined variable: shop in /in/0H7Iv on line 6 Notice: Undefined variable: shop in /in/0H7Iv on line 6 Notice: Undefined variable: shop in /in/0H7Iv on line 6 costs and you get <br /><h1>Using loops to display array elements</h1><ol><li><b>The row number 0</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li><li><b>The row number 1</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li><li><b>The row number 2</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li><li></li><li></li></ul></li></ol>
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.0.3
<h1>Manual access to each element</h1> Notice: Undefined variable: shop in /in/0H7Iv on line 4 Notice: Undefined variable: shop in /in/0H7Iv on line 4 Notice: Undefined variable: shop in /in/0H7Iv on line 4 costs and you get <br /> Notice: Undefined variable: shop in /in/0H7Iv on line 5 Notice: Undefined variable: shop in /in/0H7Iv on line 5 Notice: Undefined variable: shop in /in/0H7Iv on line 5 costs and you get <br /> Notice: Undefined variable: shop in /in/0H7Iv on line 6 Notice: Undefined variable: shop in /in/0H7Iv on line 6 Notice: Undefined variable: shop in /in/0H7Iv on line 6 costs and you get <br /><h1>Using loops to display array elements</h1><ol><li><b>The row number 0</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li><li><b>The row number 1</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li><li><b>The row number 2</b><ul> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li> Notice: Undefined variable: shop in /in/0H7Iv on line 18 <li></li></ul></li></ol>