3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $Info = array( array('name'=> 'a', 'description'=>'b'), array('name'=> 'c', 'description'=>'d'), array('name'=> 'e', 'description'=>'f') ); echo('<div class="tbl">'); foreach($this->inventory as $ID => $Info) { echo('<div class="block">'); echo('<p>Name: ' . $Info['name'] . '</p><p>Description: ' . $Info['description'] . '</p>'); echo('</div>'); } echo('</div>');
Output for 7.0.0 - 7.1.0
<div class="tbl"> Fatal error: Uncaught Error: Using $this when not in object context in /in/I7kGl:10 Stack trace: #0 {main} thrown in /in/I7kGl on line 10
Process exited with code 255.
Output for hhvm-3.12.0
<div class="tbl"> Fatal error: Uncaught Error: $this is null in /in/I7kGl:10 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
<div class="tbl"> Fatal error: $this is null in /in/I7kGl on line 10
Process exited with code 255.
Output for 5.0.0 - 5.6.28
<div class="tbl"> Fatal error: Using $this when not in object context in /in/I7kGl on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9
<div class="tbl"> Warning: Invalid argument supplied for foreach() in /in/I7kGl on line 10 </div>
Output for 4.3.11
<div class="tbl"></div>