3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $expected_array_got_string = 'test'; var_dump($expected_array_got_string['blah']); var_dump(isset($expected_array_got_string['blah'])); var_dump(isset($expected_array_got_string['jkjk'][0])); var_dump(isset($expected_array_got_string['jkjk'][0]['test'])); var_dump(isset($expected_array_got_string['jkjk']['test'][1])); var_dump(isset($expected_array_got_string['jkjk']['test'][0]));
based on FBEpk
Output for 7.0.0 - 7.2.0
Warning: Illegal string offset 'blah' in /in/djgWu on line 4 string(1) "t" bool(false) bool(false) bool(false) bool(false) bool(false)
Output for 5.4.11 - 5.6.28
Warning: Illegal string offset 'blah' in /in/djgWu on line 4 string(1) "t" bool(false) bool(true) bool(false) bool(false) bool(true)
Output for 5.3.21 - 5.3.29
string(1) "t" bool(true) bool(false) Fatal error: Cannot use string offset as an array in /in/djgWu on line 7
Process exited with code 255.