3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $as = 1; function a() {echo $this->as;} } class B extends A { protected $as = 2; function a() {echo $this->as;} function b() {parent::a();} function c() {$this->a();} function d() {echo parent::$as;} } $b = new B(); $b->a(); $b->b(); $b->c(); $b->d();
Output for git.master, git.master_jit, rfc.property-hooks
222 Fatal error: Uncaught Error: Access to undeclared static property A::$as in /in/si2f8:12 Stack trace: #0 /in/si2f8(18): B->d() #1 {main} thrown in /in/si2f8 on line 12
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.41 ms | 405 KiB | 9 Q