- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
- Fatal error: Cannot make non static method MyClass::myFunc() static in class OtherClass in /in/2C3oh on line 18
Process exited with code 255.
<?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();
?>