ID: 36337 Updated by: [EMAIL PROTECTED] Reported By: denis at edistar dot com -Status: Bogus +Status: Assigned Bug Type: Class/Object related Operating System: Linux PHP Version: 5.1.2 -Assigned To: helly +Assigned To: ilia New Comment:
Ilia, the fix is similar to the fix applied to #36308. Previous Comments: ------------------------------------------------------------------------ [2006-02-09 19:10:10] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Parent constructor returns information about the parent class, no bug here. ------------------------------------------------------------------------ [2006-02-09 12:12:27] denis at edistar dot com Description: ------------ I have a base abstract class that defines a property to be protected and that also checks this runtime using the reflection api. My purpose is to enforce the extending class to declare that property as protected too. The reflection api returns me wrong information. It returns always that the property is protected (as defined in the base class), ignoring the definition of the extending class. Reproduce code: --------------- abstract class enum { protected $_values; public function __construct() { $property = new ReflectionProperty(get_class($this),'_values'); if(!$property->isProtected()) { throw new Exception("Property _values must be declared as protected"); } } } final class myEnum extends enum { public $_values = array( 0 => 'No value', 1 => 'Value n.1', 2 => 'Value n.2', 4 => 'Value n.4' ); } $x = new myEnum(); Expected result: ---------------- Fatal error: Uncaught exception 'Exception' with message 'Property _values must be declared as protected' Actual result: -------------- No exception is thrown ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36337&edit=1
