3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Dog { public static function bark() { return 'Woof!'; } } echo Dog::bark()."\n"; // method is static, so this is ok class Cat { public function purr() // NOT static { return 'purrrrrrrrr'; } } echo Cat::purr()."\n"; // will generate deprecation warning $cat = new Cat(); echo $cat->purr()."\n"; // will work fine
based on hSWFJ
Output for 7.0.0 - 7.3.0rc3
Woof! Deprecated: Non-static method Cat::purr() should not be called statically in /in/9hdXB on line 21 purrrrrrrrr purrrrrrrrr
Output for hhvm-3.12.14 - 3.17.3
Woof! purrrrrrrrr purrrrrrrrr
Output for 5.6.0 - 5.6.30
Woof! Strict Standards: Non-static method Cat::purr() should not be called statically in /in/9hdXB on line 21 purrrrrrrrr purrrrrrrrr