On 24/07/2015 09:21, Xinchen Hui wrote:
Hey:

     I made a small PR about changes output of some types name in
debug_zval_dump, to make it behavior consistently with var_dump.
https://github.com/php/php-src/pull/1434


That function desperately needs an updated manual page. The current one recommends using call-time pass-by-reference (impossible since 5.4), and the changes to zvals in PHP 7 make its behaviour completely different from anything in PHP 5.

I've thought before that it might be best to simply deprecate it, because the only information it gives is a highly questionable refcount - though playing around, it seems to be less influenced by the act of calling the function in PHP 7.

I'm also not convinced consistency with var_dump makes particular sense. If anything, it should be extended to more accurately reflect the internal representation, since that's it's claimed purpose.

For instance, an IS_REFERENCE zval could be shown as such, with a separate refcount from the referenced value, so that you could follow along with the examples in this blog post: http://nikic.github.io/2015/05/05/Internal-value-representation-in-PHP-7-part-1 The current implementation just adds 1 to the target refcount, per this experiment: http://3v4l.org/NejOM

Regards,

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to