3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test { var $value; var $young_myself; function __construct($var) { $this->test($var); } function test($var) { $this->value=$var; if($self > 10) $this->young_myself=new self($var-10); else $this->young_myself = FALSE; } function getAge(){ if(!!$this->young_myself) return $this->value; else return "Not birth yet"; } } $new = new test(51); echo $new->young_myself->young_myself->young_myself->young_myself->young_myself->getAge();
based on hAetn
Output for 7.2.0
Notice: Undefined variable: self in /in/l2hBG on line 15 Notice: Trying to get property 'young_myself' of non-object in /in/l2hBG on line 26 Notice: Trying to get property 'young_myself' of non-object in /in/l2hBG on line 26 Notice: Trying to get property 'young_myself' of non-object in /in/l2hBG on line 26 Notice: Trying to get property 'young_myself' of non-object in /in/l2hBG on line 26 Fatal error: Uncaught Error: Call to a member function getAge() on null in /in/l2hBG:26 Stack trace: #0 {main} thrown in /in/l2hBG on line 26
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Undefined variable: self in /in/l2hBG on line 15 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Fatal error: Uncaught Error: Call to a member function getAge() on null in /in/l2hBG:26 Stack trace: #0 {main} thrown in /in/l2hBG on line 26
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: self in /in/l2hBG on line 15 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Fatal error: Call to a member function getAge() on null in /in/l2hBG on line 26
Process exited with code 255.
Output for 5.3.18 - 5.5.35
Notice: Undefined variable: self in /in/l2hBG on line 15 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Notice: Trying to get property of non-object in /in/l2hBG on line 26 Fatal error: Call to a member function getAge() on a non-object in /in/l2hBG on line 26
Process exited with code 255.