Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105620 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82123 invoked from network); 7 May 2019 15:49:21 -0000 Received: from unknown (HELO mail1.25mail.st) (206.123.115.54) by pb1.pair.com with SMTP; 7 May 2019 15:49:21 -0000 Received: from [10.0.1.86] (unknown [49.48.243.197]) by mail1.25mail.st (Postfix) with ESMTPSA id 9AC13604F1; Tue, 7 May 2019 12:53:02 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) In-Reply-To: Date: Tue, 7 May 2019 19:52:58 +0700 Cc: Nikita Popov , Nicolas Grekas , Marco Pivetta , PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: References: <76C69198-A778-4B60-8EBF-8BDEC7D2DBC1@koalephant.com> To: Steven Wade X-Mailer: Apple Mail (2.3445.104.8) Subject: Re: [PHP-DEV] Proposal for a RFC From: php-lists@koalephant.com (Stephen Reay) > On 7 May 2019, at 19:47, Steven Wade wrote: >=20 >> Maybe I=E2=80=99m missing the point (I=E2=80=99ve never used it) of = VarDumper, but isn=E2=80=99t this type of thing exactly why the = `__debugInfo` magic method exists? >=20 >=20 > I can't speak for the exact reason a library like VarDumper is using = casting versus __debugInfo, but in trying to find a substitute this = morning, I played with the method you mentioned and found that it can be = overwritten by classes and be commanded to not return anything (similar = to my __toArray proposal), whereas current functionality prevents = overriding casting to an array so casting will always give you insight = but users can overwrite __debugInfo and cause unintended effects. I = assume that's the reason for not using __debugInfo. >=20 > -- > Steven Wade > stevenwadejr@gmail.com >=20 >=20 >=20 Right, I understand that it *can* be overridden, but surely if = someone=E2=80=99s doing that, its because they want more useful = information provided in, e.g. var_dump.=