php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63614 Fatal error on Reflection
Submitted: 2012-11-26 20:33 UTC Modified: -
From: dev at pp3345 dot de Assigned:
Status: Closed Package: Reflection related
PHP Version: 5.3.19 OS: Debian Squeeze
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 + 12 = ?
Subscribe to this entry?

 
 [2012-11-26 20:33 UTC] dev at pp3345 dot de
Description:
------------
Test script leads to a fatal error. Seems to happen with both PHP 5.3 and 5.4.

Test script:
---------------
<?php

class Test
{
  const A   = 0;

  public function func()
  {
    static $a  = array(
      self::A   => 'a'
    );
  }
}

$reflect = new ReflectionMethod('Test', 'func');
$reflect->getStaticVariables();

?>


Expected result:
----------------
No Fatal Error.

Actual result:
--------------
Fatal error: Cannot access self:: when no class scope is active in test.php on 
line 16

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-27 05:34 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 [2012-11-27 05:34 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2012-11-27 05:36 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 [2012-11-27 05:37 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 [2012-11-27 05:38 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 [2012-12-19 17:55 UTC] derick@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 [2014-10-07 23:21 UTC] stas@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 [2014-10-07 23:32 UTC] stas@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7
Log: Fixed Bug #63614 (Fatal error on Reflection)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC