3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassA { public function __get($name){ return "[$name]"; } } class ClassB extends ClassA { public function __get($name){ if ($name=='one') return 1; else return parent::$name; return parent::__get($name); } } $B = new ClassB(); echo $B->one; echo $B->two;
Output for git.master, git.master_jit, rfc.property-hooks
1 Fatal error: Uncaught Error: Access to undeclared static property ClassA::$name in /in/cKJDC:15 Stack trace: #0 /in/cKJDC(22): ClassB->__get('two') #1 {main} thrown in /in/cKJDC on line 15
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:
40.12 ms | 401 KiB | 8 Q