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 $null['nope']['sure']; echo $arr['nope']; echo $arr['nope']['sure']; echo $str['nope']; echo $str['nope']['sure']; echo $num['nope']; echo $num['nope']['sure']; echo $obj['nope']; echo $obj['nope']['sure'];
Output for 7.0.0 - 7.1.0
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 Warning: Illegal string offset 'nope' in /in/IeEG8 on line 17 s Warning: Illegal string offset 'nope' in /in/IeEG8 on line 18 Warning: Illegal string offset 'sure' in /in/IeEG8 on line 18 s Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/IeEG8:23 Stack trace: #0 {main} thrown in /in/IeEG8 on line 23
Process exited with code 255.
Output for hhvm-3.12.0
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 ss Fatal error: Uncaught Error: Object does not implement ArrayAccess in /in/IeEG8:23 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 ss Fatal error: Object does not implement ArrayAccess in /in/IeEG8 on line 23
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 Warning: Illegal string offset 'nope' in /in/IeEG8 on line 17 s Warning: Illegal string offset 'nope' in /in/IeEG8 on line 18 Warning: Illegal string offset 'sure' in /in/IeEG8 on line 18 s Fatal error: Cannot use object of type stdClass as array in /in/IeEG8 on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 s Fatal error: Cannot use string offset as an array in /in/IeEG8 on line 18
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 s Fatal error: Cannot use string offset as an array in /in/IeEG8 on line 18
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Notice: Undefined index: nope in /in/IeEG8 on line 14 Notice: Undefined index: nope in /in/IeEG8 on line 15 s