|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42819 self:: resolves to namespace
Submitted: 2007-10-01 19:07 UTC Modified: 2007-10-02 08:55 UTC
From: Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2007-10-01 (CVS) OS:
Private report: No CVE-ID: None
 [2007-10-01 19:07 UTC]
PHP searches for a class named foo when accessing "self::", without the E_NOTICE this script works as expected

Reproduce code:
namespace foo;
class Bar {

    static protected
        $foo = array(
            E_NOTICE => 'foo'
        $bang = 'bang';

    static public function baz() {
        echo self::$bang;



Expected result:

Actual result:
Fatal error: Class 'foo' not found in ... on line 12


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-01 19:10 UTC]
I can verify the bug, Dmitry please take a look at it, thanks.
 [2007-10-02 08:55 UTC]
The bug wasn't rerated to self:: but to conflict between constant indexes and namespaces. It is fixed in CVS HEAD and PHP_5_3.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Mar 09 08:01:24 2021 UTC