3v4l.org

run code in 300+ PHP versions simultaneously
<?php class me { public $arm; public $leg; public function __construct() { $this->arm = 'beautiful'; $this->leg = 'pretty'; } public function setLeg($l) { $this->leg = $l; } public function getLeg() { return $this->leg; } } class myBio extends me { public $bio; public function __construc() { $this->bio = $this->getLeg(); } public function newLeg() { var_dump($this->bio); } public function tryLeg() { $this->leg = $this->getLeg(); print $this->leg; } } $mB = new myBio(); $mB->newLeg(); $mB->tryLeg();

preferences:
60.65 ms | 402 KiB | 5 Q