3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public static function get() { return 10; } public function show() { var_dump(self::get()); var_dump(static::get()); } } class B extends A { public static function get() { return '20'; } } A::show(); B::show();
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method A::show() should not be called statically in /in/UbucE on line 22 int(10) int(10) Deprecated: Non-static method A::show() should not be called statically in /in/UbucE on line 23 int(10) string(2) "20"
Output for 5.3.19 - 5.6.28
Strict Standards: Non-static method A::show() should not be called statically in /in/UbucE on line 22 int(10) int(10) Strict Standards: Non-static method A::show() should not be called statically in /in/UbucE on line 23 int(10) string(2) "20"