Re: Reflection API : Feature request and question
| From: | Jevon Wright | Date: | Wed, 05 May 2004 08:04:22 +0000 |
| Subject: | Re: Reflection API : Feature request and question | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9667@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Arjen Warendorff" <awarendorff@e-sites.nl>
To: "'PHP Internals List'" <internals@lists.php.net>
Sent: Wednesday, May 05, 2004 7:33 PM
Subject: [PHP-DEV] Reflection API : Feature request and question
> Hello,
>
> I have played around with the Reflection API, missed some features and
have
> some questions:
>
> At the moment there is no way of checking if a default parameter has a
> value, and if so, to get it's value. Example:
> function foo($bar = TRUE) {}
> The default value for $bar would be TRUE in this example (maybe a
> "hasDefaultValue()" and a "getDefaultValue()" method?).
I reported this in my bug:
http://bugs.php.net/bug.php?id=28241
It was suspended until PHP 5.1... but yes, I really think the Reflection API
needs this!
> The ReflectionFunction method "getStartLine()" would be, in my opinion)
> become even more usefull if you had something like a "getLine()" method
> which should return the source code on that line, but i might be out of my
> league here. :)
Couldn't you do this in userland? Which the PHP internals seem so obsessed
about :D
I don't know if this is truly useful - maybe if the PHP code is stored in
memory anyway, and it doesn't introduce a performance penalty...?
Jevon