3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { public static function myStaticFunction() { echo "I'm declared static! Calling me statically works great.\n"; } public function myNonStaticFunction() { echo "I'm not static, if you try to call me statically you'll get a deprecated warning\n"; } public function __call($name, $args) { echo 123;exit; } } foo::myStaticFunction(); foo::myNonStaticFunction();
based on N8mUV
Output for 7.0.0 - 7.3.0beta1
I'm declared static! Calling me statically works great. Deprecated: Non-static method foo::myNonStaticFunction() should not be called statically in /in/60OvC on line 19 I'm not static, if you try to call me statically you'll get a deprecated warning
Output for hhvm-3.15.4
I'm declared static! Calling me statically works great. I'm not static, if you try to call me statically you'll get a deprecated warning
Output for 5.6.0 - 5.6.30
I'm declared static! Calling me statically works great. Strict Standards: Non-static method foo::myNonStaticFunction() should not be called statically in /in/60OvC on line 19 I'm not static, if you try to call me statically you'll get a deprecated warning