Re: Namespace resolution rules has been changed?

From: Date: Mon, 10 Nov 2008 22:04:17 +0000
Subject: Re: Namespace resolution rules has been changed?
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-41840@lists.php.net to get a copy of this message
The problem was that it isn't immediately clear why we would consider "Sub\Object" to be the same as "\Sub\Object", but "Object" to be different from "\Object" inside a namespace context, but the same outside a namespace context. The "Sub\Object" should be understand as fully qualified identifiers and thus considered as the same as "\Sub\Object".
I understand this new behaviour is same as using "relative paths", but there is a common best practise to not make dependencies form topper namespaces to deeper ones. So it is rare to have class Company\Software\Base extending Company\Software\Web\Forms\Control (i.e. Base extends Web\Forms\Control), and it is common have class Company\Software\Web\Forms\Control extending Company\Software\Base. So in real world it means that nearly every usage of "partially qualified indentifiers" (Sub\Object) have to be written with preceding backslash. David Grudl My english is poor but I hope you understand me ;)

« previous php.internals (#41840) next »