开发者

What does "final" mean in PHP? [closed]

开发者_JAVA技巧 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.
final static public function registerAutoload(){}


It effectively means that sub-classes cannot override this method, or as the PHP final keyword documentation states:

"...prevents child classes from overriding a method by prefixing the definition with final. If the class itself is being defined final then it cannot be extended."


It means a child class cannot override the method registerAutoload.


The same as in every other language: any class that extends another containing a final method cannot override that specific method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜