Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98244 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49402 invoked from network); 7 Feb 2017 13:54:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Feb 2017 13:54:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Received: from [82.113.146.227] ([82.113.146.227:51114] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/C9-03389-BA1D9985 for ; Tue, 07 Feb 2017 08:54:53 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 54DDC10D424; Tue, 7 Feb 2017 13:54:48 +0000 (GMT) Date: Tue, 7 Feb 2017 13:54:48 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Rowan Collins cc: internals@lists.php.net In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [PHP-DEV] Change debug_zval_dump to return the dump unaffected by __debugInfo? From: derick@php.net (Derick Rethans) On Tue, 7 Feb 2017, Rowan Collins wrote: > On 7 February 2017 11:25:53 GMT+00:00, Wes wrote: > > >But even better, it would be nice if debug_zval_dump() always > >returned the debug information unaffected by custom user-defined > >__debugInfo. This is by the way what HHVM does: > >https://3v4l.org/OoJkC > > While it might be a good idea to have a way of suppressing __debugInfo > (I think this came up in the RFC discussion when it was added?), I > think debug_zval_dump should be deprecated and removed at this point. > > The main thing it claims to offer over the many other variable dumps > is the refcount, but this has never been reliable, and is now > completely broken. The example in the manual recommends using > call-time pass-by-reference, which was removed in PHP 5.4; and in PHP > 7 the nature of references has changed so radically that it's not even > clear what the correct output would be. It was always silly IMO. The best way to do this is to accept the argument's *name*, instead of the value: https://derickrethans.nl/xdebug-2.3-xdebug-debug-zval.html cheers, Derick -- https://derickrethans.nl | https://xdebug.org | https://dram.io Like Xdebug? Consider a donation: https://xdebug.org/donate.php twitter: @derickr and @xdebug