3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $messageA = "A::bar()\n"; public function bar() { print($this->messageA); C::f(); } } class B extends A { public function foo() { print("B::foo()\n"); A::bar(); } } class C extends B { private $messageC = "C::f()\n"; public function f() { print($this->messageC); } } $obj = new B; $obj->foo();
Output for git.master, git.master_jit, rfc.property-hooks
B::foo() A::bar() Fatal error: Uncaught Error: Non-static method C::f() cannot be called statically in /in/sY5AL:7 Stack trace: #0 /in/sY5AL(14): A->bar() #1 /in/sY5AL(26): B->foo() #2 {main} thrown in /in/sY5AL on line 7
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:
37.15 ms | 401 KiB | 8 Q