3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = 'hello'; var_dump(isset($foo['a'])); var_dump(isset($foo['a']), $foo['a'], isset($foo['a'][0]), $foo['a'][0]);
based on Q0C2n
Output for 7.0.0 - 7.3.1
bool(false) Warning: Illegal string offset 'a' in /in/vehe6 on line 5 Warning: Illegal string offset 'a' in /in/vehe6 on line 5 bool(false) string(1) "h" bool(false) string(1) "h"
Output for 5.4.0 - 5.6.25
bool(false) Warning: Illegal string offset 'a' in /in/vehe6 on line 5 Warning: Illegal string offset 'a' in /in/vehe6 on line 5 bool(false) string(1) "h" bool(true) string(1) "h"
Output for 5.0.3 - 5.3.29
bool(true) Fatal error: Cannot use string offset as an array in /in/vehe6 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.2
bool(false) Fatal error: Cannot use string offset as an array in /in/vehe6 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.4.9
bool(true) bool(true) string(1) "h" bool(false) NULL