-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Cannot override final method ReflectionMethod::toString() #3053
Copy link
Copy link
Closed
Labels
Description
I think this is a Zend incompatibility.
interface MyReflectionInterface
{
public function toString();
}
class MyReflectionMethod extends ReflectionMethod implements ReflectionInterface
{
public function toString()
{
return parent::__toString();
}
}I get:
Fatal error: Cannot override final method ReflectionMethod::toString()
If I remove the toString() implementation, then both Zend PHP and HHVM fail:
- HHVM: "Fatal error: Access level to MyMethodReflection::toString() must be public"
- PHP: "Fatal error: Class Zend\Code\Reflection\MethodReflection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Zend\Code\Reflection\ReflectionInterface::toString)"
This is an issue in Zend Framework 2: zendframework/zendframework#6418
Reactions are currently unavailable