3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { $foo = ''; $bar = $foo['urls']['apis']['rest']; echo $bar; } catch (Exception $e) { echo "exception"; }
based on 2R8S4
Output for 5.4.0 - 7.2.0
Warning: Illegal string offset 'urls' in /in/GqmGG on line 5 Notice: Uninitialized string offset: 0 in /in/GqmGG on line 5 Warning: Illegal string offset 'apis' in /in/GqmGG on line 5 Notice: Uninitialized string offset: 0 in /in/GqmGG on line 5 Warning: Illegal string offset 'rest' in /in/GqmGG on line 5 Notice: Uninitialized string offset: 0 in /in/GqmGG on line 5
Output for 5.2.10 - 5.3.29
Notice: Uninitialized string offset: 0 in /in/GqmGG on line 5 Fatal error: Cannot use string offset as an array in /in/GqmGG on line 5
Process exited with code 255.
Output for 5.0.0 - 5.2.9
Fatal error: Cannot use string offset as an array in /in/GqmGG on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/GqmGG on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/GqmGG on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/GqmGG on line 3
Process exited with code 255.