如何在PHP类中创建最终属性?

I would like to prevent a child class from redeclaring some parent's attributes. How can I do that?

EDIT: If my parent class has a "title" property, i don't want that children can (re)declare property with this name

i'm not sure if this will work but you could try playing with the Reflection class and detect if any child has redeclared the property and then fire an exception or something

UPDATE:

check this links out:

http://www.php.net/manual/en/reflectionproperty.getdeclaringclass.php

and

http://www.php.net/manual/en/reflectionproperty.setaccessible.php

It should help

Define class variable as private.

private $_var = 'would not be changed by a child class';