3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = ''; $bar = $foo['urls']['apis']['rest']; echo $bar;
Output for 5.4.0 - 7.2.0
Warning: Illegal string offset 'urls' in /in/2R8S4 on line 4 Notice: Uninitialized string offset: 0 in /in/2R8S4 on line 4 Warning: Illegal string offset 'apis' in /in/2R8S4 on line 4 Notice: Uninitialized string offset: 0 in /in/2R8S4 on line 4 Warning: Illegal string offset 'rest' in /in/2R8S4 on line 4 Notice: Uninitialized string offset: 0 in /in/2R8S4 on line 4
Output for 5.2.10 - 5.3.29
Notice: Uninitialized string offset: 0 in /in/2R8S4 on line 4 Fatal error: Cannot use string offset as an array in /in/2R8S4 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.2.9
Fatal error: Cannot use string offset as an array in /in/2R8S4 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.4.9