3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyClass { protected function myFunc() { echo "MyClass::myFunc()\n"; } } class OtherClass extends MyClass { // Override parent's definition public static function myFunc() { // But still call the parent function parent::myFunc(); echo "OtherClass::myFunc()\n"; } } $class = new OtherClass(); OtherClass::myFunc(); ?>
Output for 5.3.0 - 5.4.25
Fatal error: Cannot make non static method MyClass::myFunc() static in class OtherClass in /in/FWEEc on line 18
Process exited with code 255.