3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class C { private $s; public function __construct($s) { $this->s = $s; } protected function getS() { return $this->s; } } class C1 extends C { public function __get($name) { $value = 'wanted:'.$name; $this->$name = $value.',got it again'; return $value; } public function __construct($s1) { parent::__construct($s1); } function doStuff() { echo $this->getS()."\n"; echo $this->s."\n"; echo $this->s."\n"; } } $c1 = new C1('foo'); $c1->doStuff();
Output for git.master, git.master_jit, rfc.property-hooks
foo Deprecated: Creation of dynamic property C1::$s is deprecated in /in/KuTGX on line 16 wanted:s wanted:s,got it again

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:
58.94 ms | 401 KiB | 8 Q