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(); echo "------\n"; B::show();
based on erPBH
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method A::show() should not be called statically in /in/j6Ukt on line 22 int(10) int(10) ------ Deprecated: Non-static method A::show() should not be called statically in /in/j6Ukt on line 24 int(10) int(20)
Output for 5.5.0 - 5.6.28
Strict Standards: Non-static method A::show() should not be called statically in /in/j6Ukt on line 22 int(10) int(10) ------ Strict Standards: Non-static method A::show() should not be called statically in /in/j6Ukt on line 24 int(10) int(20)