#22395 [Opn->Asn]: Namespaces overwrite preexisting namespaces

From: Date: Mon, 24 Feb 2003 17:06:20 +0000
Subject: #22395 [Opn->Asn]: Namespaces overwrite preexisting namespaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-34108@lists.php.net to get a copy of this message
ID: 22395 Updated by: wez@php.net Reported By: andrew at evilwalrus dot com -Status: Open +Status: Assigned Bug Type: Zend Engine 2 problem Operating System: WinXP PHP Version: 5CVS-2003-02-24 (dev) -Assigned To: +Assigned To: zeev New Comment: Assigning to Zeev so that this doesn't get lost. Previous Comments: ------------------------------------------------------------------------ [2003-02-24 10:02:58] andrew at evilwalrus dot com 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 this bug report at http://bugs.php.net/?id=22395&edit=1

« previous php.bugs (#34108) next »