#22395 [NEW]: Namespaces overwrite preexisting namespaces
| From: | andrew at evilwalrus dot com | Date: | Mon, 24 Feb 2003 16:02:58 +0000 |
| Subject: | #22395 [NEW]: Namespaces overwrite preexisting namespaces | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-34104@lists.php.net to get a copy of this message | ||
From: andrew at evilwalrus dot com
Operating system: WinXP
PHP version: 5CVS-2003-02-24 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: Namespaces overwrite preexisting namespaces
The following code should (theoretically) generate a fatal error, as it
overwrites a predefined namespace (tested on 'parent' and 'self'
namespaces:
<?php
namespace parent
{
class foo
{
private $data;
function __construct($data)
{
$this->data = $data;
}
function debug()
{
print $this->data;
}
}
}
$foo = new parent::foo('Hello World!');
$foo->debug();
?>
----------------------------------------------------
I don't think this is done by design due to the fact that the predefined
namespaces are in place to prevent this, and also for other uses.
~ Andrew Heebner
--
Edit bug report at http://bugs.php.net/?id=22395&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22395&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22395&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22395&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22395&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22395&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22395&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22395&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22395&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22395&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22395&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22395&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22395&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22395&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22395&r=gnused