More work on reflection API

From: Date: Tue, 01 Jul 2003 21:27:08 +0000
Subject: More work on reflection API
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-3121@lists.php.net to get a copy of this message
On Tue, 2003-07-01 at 20:27, Timm Friebe wrote: > Hello, > I went ahead and spent some time on the new reflection API. A patch (778 > lines:)) and a demo script are attached. More to come: --------------------------------------------------------------------- - Added some necessary efree()'s before an exception is thrown (as ZEND_DO_THROW returns from the function immediately. - Added Reflection_Method class TBI: getDeclaringClass() - Added Reflection_Class::getModifiers which returns a long consisting of the bitmask of modifiers which are registered as constants with the following names: STATIC ABSTRACT FINAL INTERFACE ABSTRACT_CLASS FINAL_CLASS PUBLIC PROTECTED PRIVATE PPP_MASK CHANGED IMPLICIT_PUBLIC TBDiscussed: Would something like $modifiers= array('public', 'static') be cooler? Currently, one would be checking with $modifiers & STATIC etc. - Added Reflection_Class::getConstructor - Added Reflection_Class::getMethod(string name) - Added Reflection_Class::getMethods() --------------------------------------------------------------------- > I couldn't figure out how to remove the following memleaks which > occur when the reflection_class_factory is called: I found and eliminated them:) Btw, the Reflection_Method->invoke() will not work without the patch to zend_execute_API.c in my previous mail to engine2@. - Timm

Attachment: [text/x-patch] zend_reflection_api.c.diff.2
Attachment: [application/x-php] reflection.php
« previous php.internals (#3121) next »