3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function foo() { echo __METHOD__ . PHP_EOL; } } class b extends a {} class c extends b { function bar() { $this::foo(); $this->foo(); a::foo(); b::foo(); c::foo(); d::foo(); static::foo(); self::foo(); parent::foo(); } } class d extends c {} (new c)->bar();
Output for git.master_jit, git.master
a::foo a::foo a::foo a::foo a::foo Fatal error: Uncaught Error: Non-static method a::foo() cannot be called statically in /in/j04vj:17 Stack trace: #0 /in/j04vj(26): c->bar() #1 {main} thrown in /in/j04vj on line 17
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:
43 ms | 866 KiB | 4 Q