3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); $null = null; $obj = new stdClass(); $arr = array(); $str = 'string'; $num = 1; echo $null['nope']; echo $arr['nope']; echo $str['nope']; echo $num['nope']; echo $null['nope']['sure']; echo $arr['nope']['sure']; echo $str['nope']['sure']; echo $num['nope']['sure'];
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined index: nope in /in/8uZGr on line 12 Warning: Illegal string offset 'nope' in /in/8uZGr on line 13 s Notice: Undefined index: nope in /in/8uZGr on line 17 Warning: Illegal string offset 'nope' in /in/8uZGr on line 18 Warning: Illegal string offset 'sure' in /in/8uZGr on line 18 s
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: nope in /in/8uZGr on line 12 s Notice: Undefined index: nope in /in/8uZGr on line 17 s
Output for 5.3.0 - 5.3.29
Notice: Undefined index: nope in /in/8uZGr on line 12 s Notice: Undefined index: nope in /in/8uZGr on line 17 Fatal error: Cannot use string offset as an array in /in/8uZGr on line 18
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Notice: Undefined index: nope in /in/8uZGr on line 12 s Notice: Undefined index: nope in /in/8uZGr on line 17 Fatal error: Cannot use string offset as an array in /in/8uZGr on line 18
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Notice: Undefined index: nope in /in/8uZGr on line 12 s Notice: Undefined index: nope in /in/8uZGr on line 17