From:             jw at jwscripts dot com
Operating system: Windows XP
PHP version:      5CVS-2004-02-15 (dev)
PHP Bug Type:     Class/Object related
Bug description:  Reflection API :: Reflection_Property fails when a const is passed 

Description:
------------
When passing a constant to the constructor of the Reflection_Property
class, an exception is thrown.



You can work around this, e.g., by creating an instance of the
Reflection_Object class instead, but this isn't very pretty.



The same problem occurres when a constant with one or more uppercased
characters is defined, e.g.:



const $TEST = "foo";



 

Reproduce code:
---------------
<?



class Foo {

        const TEST = "foo";

        // Fails too: static $TEST = "foo";

        // Success  : static $test = "foo";

}



class Types extends Reflection_Property {

        public function __construct($object, $name) {

                parent::__construct($object, $name);

        }

}



$types = new Types("Foo", "TEST");



?>

Expected result:
----------------
No output

Actual result:
--------------
Fatal error: Uncaught exception 'reflection_exception' with message
'Property Foo::$TEST does not exist' in [...] Stack trace: #0 [...](13):
Types->__construct() #1 {main} thrown in [...] on line [...]



-- 
Edit bug report at http://bugs.php.net/?id=27265&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27265&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27265&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27265&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27265&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27265&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27265&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27265&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27265&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27265&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27265&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27265&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27265&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27265&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27265&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27265&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27265&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27265&r=float

Reply via email to