Re: new Class ReflectionZVal
| From: | Derick Rethans | Date: | Mon, 07 Jan 2013 17:22:14 +0000 |
| Subject: | Re: new Class ReflectionZVal | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64643@lists.php.net to get a copy of this message | ||
On Mon, 7 Jan 2013, nathan@starin.biz wrote:
> I wanted some thought from you guys about the idea of giving PHP scripts the
> ability to read some internal information about variables such as ZVals.
>
>
>
> The idea of how this reflection class would work would be something like:
>
>
>
> Class ReflectionZVal {
>
> // Retains info about the variable referenced
>
> function __construct(&$variable);
That's inherently flawed, as passing a variable in can modify it's
refcount and is_ref states. This is why Xdebug's equivalent wants a
string with the variable name instead:
http://xdebug.org/docs/all_functions#xdebug_debug_zval
> // Returns if the referenced variable
>
> function valueExists();
What's a "referenced variable" here? If you pass in something, it will
exist.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine