3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $menuitems = array('name'=>'First menu item', 'link'=>'http://firstitem.com','class'=>'normal'); foreach ($menuitems as $menuitem) { echo "<a href='{$menuitem['link']}' class='{$menuitem['class']}'>{$menuitem['name']}</a>"; }
Output for 5.4.0 - 7.1.0
Warning: Illegal string offset 'link' in /in/1iqt2 on line 5 Warning: Illegal string offset 'class' in /in/1iqt2 on line 5 Warning: Illegal string offset 'name' in /in/1iqt2 on line 5 <a href='F' class='F'>F</a> Warning: Illegal string offset 'link' in /in/1iqt2 on line 5 Warning: Illegal string offset 'class' in /in/1iqt2 on line 5 Warning: Illegal string offset 'name' in /in/1iqt2 on line 5 <a href='h' class='h'>h</a> Warning: Illegal string offset 'link' in /in/1iqt2 on line 5 Warning: Illegal string offset 'class' in /in/1iqt2 on line 5 Warning: Illegal string offset 'name' in /in/1iqt2 on line 5 <a href='n' class='n'>n</a>
Output for 4.3.0 - 5.3.29
<a href='F' class='F'>F</a><a href='h' class='h'>h</a><a href='n' class='n'>n</a>