3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.3.0 - 8.3.4
Warning: Trying to access array offset on null in /in/8uZGr on line 11 Warning: Undefined array key "nope" in /in/8uZGr on line 12 Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /in/8uZGr:13 Stack trace: #0 {main} thrown in /in/8uZGr on line 13
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
Warning: Trying to access array offset on value of type null in /in/8uZGr on line 11 Warning: Undefined array key "nope" in /in/8uZGr on line 12 Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /in/8uZGr:13 Stack trace: #0 {main} thrown in /in/8uZGr on line 13
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Trying to access array offset on value of type null in /in/8uZGr on line 11 Notice: Undefined index: nope in /in/8uZGr on line 12 Warning: Illegal string offset 'nope' in /in/8uZGr on line 13 s Notice: Trying to access array offset on value of type int in /in/8uZGr on line 14 Notice: Trying to access array offset on value of type null in /in/8uZGr on line 16 Notice: Trying to access array offset on value of type null in /in/8uZGr on line 16 Notice: Undefined index: nope in /in/8uZGr on line 17 Notice: Trying to access array offset on value of type null 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 Notice: Trying to access array offset on value of type int in /in/8uZGr on line 19 Notice: Trying to access array offset on value of type null in /in/8uZGr on line 19
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
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 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.0.5, 5.1.0 - 5.1.6, 5.2.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.3.11, 4.4.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

preferences:
244.64 ms | 401 KiB | 393 Q