Re: Getting a list of registered namespaces.

From: Date: Thu, 16 Jun 2011 17:54:12 +0000
Subject: Re: Getting a list of registered namespaces.
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-53341@lists.php.net to get a copy of this message
On Thu, Jun 16, 2011 at 7:48 PM, Richard Quadling <rquadling@gmail.com>wrote: > On 16 June 2011 17:40, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > > Hi! > > > > On 6/16/11 8:37 AM, Richard Quadling wrote: > >> > >> Maybe, but because of a lack of convention on naming, we have > namespaces. > > > > No, we have namespaces not because we couldn't agree on naming > convention, > > but because any naming convention without namespaces would lead to ugly > code > > (which you call "sensible long names" but which rapidly stop being > sensible > > if you actually try to do it). > > I was joking. > > > > >> So it would seem appropriate to have the ability to investigate a > >> namespace to see what it contains and/or if it exists. > >> > >> Why? For exactly the same reasons you have class_exists(), > >> interface_exists(), function_exists(). > > > > Classes and functions actually exist as objects in the engine. Namespaces > do > > not. They are just parts of names. You can not instantiate a namespace, > you > > can not call a namespace. So these reasons do not apply. > > > And now I understand. Thanks for that. > > Okay, so namespaces doesn't exists for the engine, because they are added to the classnames in compile-time, but we could add some --rX argument for the php binary, which would iterate over the classes and functions and so for a given extension, and fetch and list the introduced namespaces. what do you think? Tyrael

« previous php.internals (#53341) next »