3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static function static_method() { echo "Here's your static method: Foo!\n"; } function static_method_caller() { echo "static_method_caller says: "; $this->static_method(); } function non_static() { echo "I am not a static method\n"; } } $t = new Test(); $t->static_method(); $t->static_method_caller(); Test::non_static();
Output for git.master, git.master_jit, rfc.property-hooks
Here's your static method: Foo! static_method_caller says: Here's your static method: Foo! Fatal error: Uncaught Error: Non-static method Test::non_static() cannot be called statically in /in/jF7eL:20 Stack trace: #0 {main} thrown in /in/jF7eL on line 20
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:
48.64 ms | 401 KiB | 8 Q