This article introduces the [php classes and objects] Final keyword, which has a certain reference value. Now I share it with you. Friends in need can refer to it
Final keyword
Declared as Final:
1.类,不能被继承。 2.方法,不能被子类覆盖。 3.属性,常量,不能被定义为 Final
Example #1 Final 方法示例
Example #2 Final 类示例
Related recommendations:
[php classes and objects] late static binding
[php classes and objects] Type constraints
[php classes and objects] Object copy
The above is the detailed content of [php classes and objects] Final keyword. For more information, please follow other related articles on the PHP Chinese website!