Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5699 invoked from network); 25 Jul 2015 11:49:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2015 11:49:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.15 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.15 mout.gmx.net Received: from [212.227.15.15] ([212.227.15.15:59067] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/60-25375-1D773B55 for ; Sat, 25 Jul 2015 07:49:38 -0400 Received: from [192.168.0.100] ([95.89.139.132]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lxgt9-1YpZ5B0ERv-017E3j; Sat, 25 Jul 2015 13:49:34 +0200 Message-ID: <55B377D5.8060602@gmx.de> Date: Sat, 25 Jul 2015 13:49:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Rowan Collins , internals@lists.php.net References: <55B2E975.50607@gmail.com> In-Reply-To: <55B2E975.50607@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:FkWRzScHmEDAYEVvlcAPgyOk35RGiz5jO1jfVnXb1+eFEIPm+ve 7CFb04jmfDYUdvz/x5y6txvG+ARx9Gf7Kq2+qyvL1+rxIIN87BHuib4hRcTbBPaEQKYJW92 sh00gRzfZ5crPsgoccvsZhnhUoXmqey2T/4LrOj0Mtax+EVzFfy081BZMFDx+kVf2HP0USO JGb+WSFpvNEH3VORvupaw== X-UI-Out-Filterresults: notjunk:1;V01:K0:o0iypBFBRyQ=:+2bonruxbdYzlzPB9BeOlH BnHznbUV36DeQm5WgB/HHTrI/5fTyMee6s6QNp3wBE/ZTWWh6cwJFA76yrl7CryeNrspH1IBm WKljAoH/B6izqAEFipEouwIJV506N9qTc/YhUpwO+FLQK+N7wGFlCm8mFgQPv75uWAD4dXFX1 UTCfkRgg8E8CxOrZ5+DNl0gNinHk9ifnoujVJiA2EF0ILatdr/lNMiWAQaw8vgcOUDkaayhT6 WvmfT9cw4KEZDlB6pf9J0dAYM1ulagkSkfi7q22lkR+LeEQ7xvEnZQGuQadO6HGd2wbtO5O5O Wm9ucqbYvHslMIusiBl3PB1PkN6YolA5tGaXGtjKw7zfTy/kEvs/4MkZr2tox7AgHKBnYHW0k RBf0VgBaLka3mP5nVQcRJ63j5eDNI71tZKNRADoqkyi+ElAQ8DzBzfWD0SSIn71gsDI/TSVAo ldaHgBV1psFpQy+KOOUVCrYFT2hO7G7OoZOpomu8xLSBtzverw7oNJnEckVzBioUZF1LhnYbh M/Z6C9v9GWJDcGYmWN/obOXGoheDLxEaqSnMm9wi+Tf9aVOndZ3yOEQ6kwsd4h5UgFeakNK8R 9U41dyLU+T6pDJIVzTgc6M5+m8vfP0iYKi+4sVWwZP399SGPGMd8v7pldjx30dMIEE9HiOanX in3Si8jFZcQeWs2vMJGPwV2GhC9SDWUeEnhfaOtv35OajDYmKXdr2Z/iQEuHc/ok4vQs= Subject: Re: [PHP-DEV] Make debug_zval_dump prints int as long From: cmbecker69@gmx.de (Christoph Becker) Rowan Collins wrote: > On 24/07/2015 09:21, Xinchen Hui wrote: >> >> 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 agree that the manual page needs an update, but it seems that would result in an even more lengthy explanation of the caveats due to the different behavior under PHP 5 and PHP 7, respectively. > 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. It seems to me that the basic issue of debug_zval_dump() is that it is a function and not a language construct, so the refcounts are never "quite right". The variadic nature of the function may add to the confusion, see . > 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 Apparently, this has been done deliberately for compatibility reasons[1]. [1] -- Christoph M. Becker