Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44376 invoked from network); 25 Jul 2015 01:42:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2015 01:42:20 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:37395] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/E4-10459-A79E2B55 for ; Fri, 24 Jul 2015 21:42:19 -0400 Received: by wibud3 with SMTP id ud3so52166290wib.0 for ; Fri, 24 Jul 2015 18:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=hl+ojsWeth7QNpIy9Dw1xO6wcBrqmi9WcZrJQKS3s1M=; b=ulEm5e4MfclgGOSOJaQ189nfh++WBi6x38XDyZ1hknebzvUa/9Mmsoy+FsN+fucIbx 8cmXivH3iZZO9wtDBfG9tCE9epU+2Tri4eKt6ysy5+Vx9Kh29ClG9SIsxKaNlWw2uc/u P8jH21CbiK+AFBwCSLOREGgFxWvxSHpAUKBCmkrec5hQ689oR2nmiSVvygeWJWL+K3M7 ObfRh9Vk3opUaU4CeI/QY6KYJ118GVqLjYdZAeKenPcP+ppRRbbUbJ/TV0oQrulVhCUW fZCQ4RdoTlP8fpXNXqJE4X0DFIZXWj9cfiHNFQ/R6HuWQIpGur/LrMKCm0l5wk7zhtvJ RDMA== X-Received: by 10.194.86.161 with SMTP id q1mr33387271wjz.18.1437788535475; Fri, 24 Jul 2015 18:42:15 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by smtp.googlemail.com with ESMTPSA id q4sm15273739wja.24.2015.07.24.18.42.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 18:42:14 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <55B2E975.50607@gmail.com> Date: Sat, 25 Jul 2015 02:42:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Make debug_zval_dump prints int as long From: rowan.collins@gmail.com (Rowan Collins) 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]