3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new stdClass; $a->b = 1; echo 'Without isset.....'."\n";; var_dump(isset($a)); var_dump(isset($a->b)); var_dump(isset($a->b->c)); var_dump(isset($a->b->c->d)); var_dump(isset($a->b->c->d->e)); echo 'Without isset.....'."\n"; var_dump($a); var_dump($a->b); var_dump($a->b->c); var_dump($a->b->c->d); var_dump($a->b->c->d->e);
Output for 5.1.6 - 5.6.28, 7.0.0 - 7.1.0
Without isset..... bool(true) bool(true) bool(false) bool(false) bool(false) Without isset..... object(stdClass)#1 (1) { ["b"]=> int(1) } int(1) Notice: Trying to get property of non-object in /in/coRIE on line 18 NULL Notice: Trying to get property of non-object in /in/coRIE on line 19 Notice: Trying to get property of non-object in /in/coRIE on line 19 NULL Notice: Trying to get property of non-object in /in/coRIE on line 20 Notice: Trying to get property of non-object in /in/coRIE on line 20 Notice: Trying to get property of non-object in /in/coRIE on line 20 NULL
Output for hhvm-3.12.0
Without isset..... bool(true) bool(true) bool(false) bool(false) bool(false) Without isset..... object(stdClass)#1 (1) { ["b"]=> int(1) } int(1) Notice: Cannot access property on non-object in /in/coRIE on line -1 NULL Notice: Cannot access property on non-object in /in/coRIE on line -1 Notice: Cannot access property on non-object in /in/coRIE on line -1 NULL Notice: Cannot access property on non-object in /in/coRIE on line -1 Notice: Cannot access property on non-object in /in/coRIE on line -1 Notice: Cannot access property on non-object in /in/coRIE on line -1 NULL
Output for hhvm-3.10.0
Without isset..... bool(true) bool(true) bool(false) bool(false) bool(false) Without isset..... object(stdClass)#1 (1) { ["b"]=> int(1) } int(1) Notice: Cannot access property on non-object in /in/coRIE on line 18 NULL Notice: Cannot access property on non-object in /in/coRIE on line 19 Notice: Cannot access property on non-object in /in/coRIE on line 19 NULL Notice: Cannot access property on non-object in /in/coRIE on line 20 Notice: Cannot access property on non-object in /in/coRIE on line 20 Notice: Cannot access property on non-object in /in/coRIE on line 20 NULL
Output for 5.0.0 - 5.1.5
Without isset..... bool(true) bool(true) bool(false) Notice: Trying to get property of non-object in /in/coRIE on line 10 bool(false) Notice: Trying to get property of non-object in /in/coRIE on line 11 Notice: Trying to get property of non-object in /in/coRIE on line 11 bool(false) Without isset..... object(stdClass)#1 (1) { ["b"]=> int(1) } int(1) Notice: Trying to get property of non-object in /in/coRIE on line 18 NULL Notice: Trying to get property of non-object in /in/coRIE on line 19 Notice: Trying to get property of non-object in /in/coRIE on line 19 NULL Notice: Trying to get property of non-object in /in/coRIE on line 20 Notice: Trying to get property of non-object in /in/coRIE on line 20 Notice: Trying to get property of non-object in /in/coRIE on line 20 NULL
Output for 4.3.0 - 4.4.9
Without isset..... bool(true) bool(true) bool(false) bool(false) bool(false) Without isset..... object(stdClass)(1) { ["b"]=> int(1) } int(1) NULL NULL NULL