#38039 [Opn]: ReflectionCLass can't find "self::" constants

From: Date: Sat, 08 Jul 2006 14:03:00 +0000
Subject: #38039 [Opn]: ReflectionCLass can't find "self::" constants
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99232@lists.php.net to get a copy of this message
ID: 38039 User updated by: baldurien at bbnwn dot eu Reported By: baldurien at bbnwn dot eu Status: Open Bug Type: Unknown/Other Function Operating System: Windows XP PHP Version: 5.1.4 New Comment: Forgot to add that thing : echo $clazz; Previous Comments: ------------------------------------------------------------------------ [2006-07-08 13:53:44] baldurien at bbnwn dot eu Description: ------------ Hi, When I use the "self::" syntax in function parameter - or a in a constant - the reflection API fails to find the constant. Note that when using Foo::X, it works. Reproduce code: --------------- class Foo { const X = 1; const Y = self::X; function f($f = self::X) {} } $clazz = new ReflectionClass('Foo'); Expected result: ---------------- No notice Actual result: -------------- Notice: Use of undefined constant self::X - assumed 'self::X' in admintools\tests\testmaker.php on line 31 Notice: Use of undefined constant self::X - assumed 'self::X' in admintools\tests\testmaker.php on line 31 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38039&edit=1

« previous php.bugs (#99232) next »