3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = ''; var_dump(isset($a->b)); $a = 'a'; var_dump(isset($a->b)); $a = '0'; var_dump(isset($a->b)); $a = ''; var_dump(isset($a['b'])); $a = 'a'; var_dump(isset($a['b'])); $a = '0'; var_dump(isset($a['b'])); $simpleString = "Bogus String Text"; echo isset($simpleString->wrong)?"bug\n":"ok\n"; echo isset($simpleString["wrong"])?"ok\n":"bug\n"; echo isset($simpleString[-1])?"bug\n":"ok\n"; echo isset($simpleString[0])?"ok\n":"bug\n"; echo isset($simpleString["0"])?"ok\n":"bug\n"; echo isset($simpleString["16"])?"ok\n":"bug\n"; echo isset($simpleString["17"])?"bug\n":"ok\n"; echo isset($simpleString["wrong"][0])?"bug\n":"ok\n"; echo $simpleString->wrong === null?"ok\n":"bug\n"; echo $simpleString["wrong"] === "B"?"ok\n":"bug\n"; echo $simpleString["0"] === "B"?"ok\n":"bug\n"; $simpleString["wrong"] = "f"; echo $simpleString["0"] === "f"?"ok\n":"bug\n";
Output for 7.1.0
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) ok bug bug ok ok ok ok ok Notice: Trying to get property of non-object in /in/BXaud on line 25 ok Warning: Illegal string offset 'wrong' in /in/BXaud on line 26 ok ok Warning: Illegal string offset 'wrong' in /in/BXaud on line 28 ok
Output for 7.0.0 - 7.0.14
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) ok bug ok ok ok ok ok ok Notice: Trying to get property of non-object in /in/BXaud on line 25 ok Warning: Illegal string offset 'wrong' in /in/BXaud on line 26 ok ok Warning: Illegal string offset 'wrong' in /in/BXaud on line 28 ok
Output for hhvm-3.12.0
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) ok bug ok ok ok ok ok bug Notice: Cannot access property on non-object in /in/BXaud on line 25 ok ok ok ok
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.6.28
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) ok bug ok ok ok ok ok bug Notice: Trying to get property of non-object in /in/BXaud on line 25 ok Warning: Illegal string offset 'wrong' in /in/BXaud on line 26 ok ok Warning: Illegal string offset 'wrong' in /in/BXaud on line 28 ok
Output for 5.0.4 - 5.3.29
bool(false) bool(false) bool(false) bool(false) bool(true) bool(true) ok ok ok ok ok ok ok ok Notice: Trying to get property of non-object in /in/BXaud on line 25 ok ok ok ok
Output for 5.0.3
bool(false) bool(true) bool(true) bool(false) bool(true) bool(true) bug ok ok ok ok ok ok ok Notice: Trying to get property of non-object in /in/BXaud on line 25 ok ok ok ok
Output for 5.0.0 - 5.0.2
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) ok bug bug ok bug bug ok ok Notice: Trying to get property of non-object in /in/BXaud on line 25 ok ok ok ok
Output for 4.3.3 - 4.4.9
bool(false) bool(false) bool(false) bool(false) bool(true) bool(true) ok ok ok ok ok ok ok ok ok ok ok ok
Output for 4.3.0 - 4.3.2
bool(false) bool(false) bool(false) Notice: Uninitialized string offset: 0 in /in/BXaud on line 10 bool(false) bool(true) bool(true) ok ok Notice: Uninitialized string offset: -1 in /in/BXaud on line 19 ok ok ok ok Notice: Uninitialized string offset: 17 in /in/BXaud on line 23 ok ok ok ok ok ok