Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112977 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80183 invoked from network); 25 Jan 2021 00:43:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jan 2021 00:43:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A0F081804D1 for ; Sun, 24 Jan 2021 16:24:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from malamute.woofle.net (woofle.net [74.207.252.100]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 24 Jan 2021 16:24:45 -0800 (PST) Received: by malamute.woofle.net (Postfix) with ESMTPSA id A58A71EFAB; Sun, 24 Jan 2021 16:24:44 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) In-Reply-To: Date: Sun, 24 Jan 2021 16:24:43 -0800 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <8A960D21-CA74-436F-97FF-B8D76E6D8703@woofle.net> References: <5ae166a8-378e-b3bc-056a-8ccf4f3a1ddd@gmail.com> To: Rowan Tommins X-Mailer: Apple Mail (2.3654.40.0.2.32) Subject: Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export() From: dusk@woofle.net (Dusk) On Jan 24, 2021, at 05:42, Rowan Tommins = wrote: > As far as I know I have never had any reason to generate code and then = eval() it, and can't think of a situation where I ever would. If I = wanted a machine-readable output from a variable, I would use = serialize() or json_encode(). >=20 > That's not to say that there aren't cases where those requirements do = happen, but I think it is a very niche use case to dedicate two = different built-in functions to. There's an interesting edge case where this does become useful. If an = evaluable representation of a data structure is written to a file = (wrapped with `