getConstants emits fatal error on selfreferencing constants.

Bug #53915 ReflectionClass::getConstants emits fatal error on selfreferencing constants.
Submitted: 2011-02-03 04:07 UTC Modified: 2011-02-03 13:45 UTC
From: david at grudl dot com Assigned: cataphract (profile)
Status: Closed Package: Reflection related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None

 [2011-02-03 04:07 UTC] david at grudl dot com

Description:
------------
This code throws fatal error: Cannot access self:: when no class scope is active

Test script:
---------------
class Foo
{
	const A = 1;
	const B = self::A;
}

$rc = new ReflectionClass('Foo');
$rc->getConstants(); // crashes




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2011-02-03 13:10 UTC] cataphract@php.net

-Summary: ReflectionClass::getConstants crashes on selfreferencing constants. +Summary: ReflectionClass::getConstants emits fatal error on selfreferencing constants. -Assigned To: +Assigned To: cataphract