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