3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface WithStaticMethod { static function foo(); } class Foo implements WithStaticMethod { public static function foo() { return __CLASS__; } } $fooClass = Foo::class; echo $fooClass::$foo();
Output for 7.0.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/HvZAc on line 7 Fatal error: Constructor Foo::foo() cannot be static in /in/HvZAc on line 7
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Fatal error: Constructor Foo::foo() cannot be static in /in/HvZAc on line 9
Process exited with code 255.