Re: Reflection and used classes
Hugh Oxford wrote:
> Is there any way of using reflection to find out what classes other
> classes use?
>
> I do not mean which classes extend other classes, I mean within methods,
> for example, where the "new" keyword instantiates objects of other classes.
>
> Any ideas?
Sorry, but in languages like PHP here is no way to do such things
reliably. This is real code from my current project:
<CODE>
....
$classname=self::getClassName($classId);
$filename=strtolower($classId.'.object.php');
include_once $filename;
$object= new $classname($this,$parentId,$name);
....
</CODE>
Class names taken from XML file. So if you have case like this and
PHPxref is not enough for you - I think here are tools to do this as you
want.
|