Re: Reflection API
| From: | Alan Knowles | Date: | Fri, 04 Jul 2003 00:40:45 +0000 |
| Subject: | Re: Reflection API | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3235@lists.php.net to get a copy of this message | ||
having had a quick think about this, here some thoughts that may affect it.
What is the API going to be used for.
a) replacement for method_exists(), call_user_func() in code
.. which makes sense for the object methods...
b) quick testing of what an interface is - as in print_r() is quicker than opening the file/looking at the details...
.. which makes sense for having a property access system...
* imagine it.. - you need to look up the docs for a file, and you are editing something that uses it.. - just type in print_r(new reflection_class('HTML_Quickform')); in your current file, to remind you of the api..
I seriously doubt that it will be used by code analysis tools due the the need to load the file/class into the interpreter (which phpdoc/docu/codedoc dont do for speed/caching/conflict issues), so those are the only two common situations where I can envision it being use heavily.
I dont see any major issues in using both access methods, they both have their uses and focus.
Regards
Alan
Andi Gutmans wrote:
At 06:40 PM 3/7/2003 -0400, Jon Parise wrote:On Thu, Jul 03, 2003 at 03:36:58PM +0200, moshe doron wrote: It's not an annoyance - it's not my spec, I'm just implementing it. I'm happy to change the code to work via properties instead, it's not a major change. I would like to settle on a concensus first.+1 (maybe both)?Please, not both. I think it would be best if there was one way to get at this information. I don't have a personal preference for either, though.I agree. We should only have one way and I personally prefer methods. Andi