php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
 [2011-02-03 13:38 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=307970
Log: - Fixed bug #53915: ReflectionClass::getConstant(s) emits fatal error on
  constants with self::.
- Reflown some NEWS entries to have lines no longer than 80 chars.
 [2011-02-03 13:45 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=307971
Log: - Simpler fix for bug #53915.
 [2011-02-03 13:45 UTC] cataphract@php.net
-Status: Assigned +Status: Closed
 [2011-02-03 13:45 UTC] cataphract@php.net
Fixed in 5.3 and trunk.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 09:01:30 2024 UTC