Re: 5.3 and reflection

From: Date: Tue, 13 May 2008 21:20:36 +0000
Subject: Re: 5.3 and reflection
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-37635@lists.php.net to get a copy of this message
Hi!
I'm installing a recent snap of 5.3 on my dev server. The app I'm working on makes heavy use of reflection. How has reflection changed in 5.3 to address namespaces? What resolution rules apply when creating a
Namespaces should not have big influence on reflection, since namespace is just the logical partitioning of the class name - i.e. if the class name is Foo::Bar::Baz, you can say that Foo::Bar is the namespace, but for reflection you still use full class name.
ReflectionClass? If I try to create a ReflectionClass for a class that is outside the current namespace, what will happen?
You should be able to use any class name with ReflectionClass. Since namespaces are compile-time only, at runtime there's no such thing as "current namespace".
Also, are there any plans to address namespaces themselves in the reflection API (i.e. ReflectionNamespace objects, getNamespace() method in the ReflectionClass object, etc)?
See above, it should answer these questions. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#37635) next »