#42819 [Asn->Csd]: self:: resolves to namespace
| From: | dmitry@php.net | Date: | Tue, 02 Oct 2007 08:55:45 +0000 |
| Subject: | #42819 [Asn->Csd]: self:: resolves to namespace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118047@lists.php.net to get a copy of this message | ||
ID: 42819
Updated by: dmitry@php.net
Reported By: bs@php.net
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
PHP Version: 5CVS-2007-10-01 (CVS)
Assigned To: dmitry
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2007-10-01 19:10:05] johannes@php.net
I can verify the bug, Dmitry please take a look at it, thanks.
------------------------------------------------------------------------
[2007-10-01 19:07:35] bs@php.net
Description:
------------
PHP searches for a class named foo when accessing "self::", without the
E_NOTICE this script works as expected
Reproduce code:
---------------
<?php
namespace foo;
class Bar {
static protected
$foo = array(
E_NOTICE => 'foo'
),
$bang = 'bang';
static public function baz() {
echo self::$bang;
}
}
foo::Bar::baz();
Expected result:
----------------
bang
Actual result:
--------------
Fatal error: Class 'foo' not found in ... on line 12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42819&edit=1