Re: Enumerate visible class names in current scope

From: Date: Mon, 19 May 2014 12:37:54 +0000
Subject: Re: Enumerate visible class names in current scope
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-74359@lists.php.net to get a copy of this message
On Mon, 2014-05-19 at 17:04 +0800, Aaron Lewis wrote: > Hi Kris, > > Thanks for the quick reply. I found class_table HashTable structure in > that zend function. > > But, do you know how to tell between user-defined classes and predefined ones? Please take a minute or two to try to find answers to such questions yourself. i.e. look at the class entry data structure, wonder whether the "type" element might be related, grep for it and see that it is set to either ZEND_INTERNAL_CLASS or ZEND_USER_CLASS. An alternative approach to figure this out is to think about a way to get this information from userspace, this should lead you to reflection, and that to the implementation of ReflectionClass::isUserDefined() in http://lxr.php.net/xref/PHP_TRUNK/ext/reflection/php_reflection.c#3574 Yes, the documentation is limited on these things but most things can be figured out with some research. If you researched and are unsure feel free to ask, and we are welcoming questions, but please mind that you are sending the questions to a few hundred persons trying to follow the PHP development ... Thanks johannes

Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
« previous php.internals (#74359) next »