3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for git.master, git.master_jit
Warning: Undefined variable $self in /in/l2hBG on line 15 Warning: Attempt to read property "young_myself" on bool in /in/l2hBG on line 26 Warning: Attempt to read property "young_myself" on null in /in/l2hBG on line 26 Warning: Attempt to read property "young_myself" on null in /in/l2hBG on line 26 Warning: Attempt to read property "young_myself" on null 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 rfc.property-hooks
Warning: Undefined variable $self in /in/l2hBG on line 15 Warning: Attempt to read property "young_myself" on false in /in/l2hBG on line 26 Warning: Attempt to read property "young_myself" on null in /in/l2hBG on line 26 Warning: Attempt to read property "young_myself" on null in /in/l2hBG on line 26 Warning: Attempt to read property "young_myself" on null 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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.97 ms | 401 KiB | 8 Q