3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class A { function B() { var_dump($this); } static function C() { var_dump($this); } } $a = new A(); echo "Calling B statically referenced: "; $a::B(); echo "Calling C statically referenced: "; $a::C(); echo "Calling B statically: "; A::B(); echo "Calling C statically: "; A::C(); echo "Calling B instantiated: "; $a->B(); echo "Calling C instantiated: "; $a->C();
Output for git.master, git.master_jit, rfc.property-hooks
Calling B statically referenced: Fatal error: Uncaught Error: Non-static method A::B() cannot be called statically in /in/HvBH9:15 Stack trace: #0 {main} thrown in /in/HvBH9 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:
29.74 ms | 401 KiB | 8 Q