Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109466 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35848 invoked from network); 30 Mar 2020 19:12:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Mar 2020 19:12:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DA3B6180562 for ; Mon, 30 Mar 2020 10:38:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (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 ; Mon, 30 Mar 2020 10:38:04 -0700 (PDT) Received: by mail-vs1-f43.google.com with SMTP id y138so11615718vsy.0 for ; Mon, 30 Mar 2020 10:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xss7sfq5lbDlfbsMPnYEHazsgXYgHrMf3d3XBr9DeAY=; b=tqLfQ3SGqWl74zCRsVeUIsMAqFuBjdmXWBV3qMmykTpIHhNkiXGMmtS5LUy71MWmZ2 6xJ3z37+pseFKJuQb/xCdVXJj6Sndm7odWZmj5v5u4mUHUG5JeOJBHlP4iAP4A3Kzylk xKvPL0SLfcxBLPX4La9zl/NkaO2EdJGMP6WIBKjU30KmWBkomZgfZ/Q5S70n4ijJV0Ub rjEeiH6QnU+Sc+TJtSB9KJltRsQGSIVV+/Y48U85Zu1Fi5pNQWvJe3/NLlKnwiy0KV/a jUH2JSiacjolsXKD5JClyp6k25C4YvS8TBF+Q8vhuJKEz40lNQJ91rRMKms8j7ql1yZ5 oG9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xss7sfq5lbDlfbsMPnYEHazsgXYgHrMf3d3XBr9DeAY=; b=oM1MeLNAGQPVieg4XnqnkM5Zm2fpbvXO9MhTswA+WN0+Noq3t2EcG87+nzxbTKHVeo 3HdLjJCwV2uk0tE/+DM3ZRlmJyWUh6w6YgfO9Djfk5JUOcUm5qr+VkALIhOruGSL2Vi6 8wuOb4nMBU/asZ1tE9NNl+sA4PCrHflCtEWgzmw9UGlptfgdqsosYhRZm9xKTA+8g+3z AO23ocbArDdsQo0W7SN01LNcbJoGxBXqyxIGRaLRVjJ2O4p7a/IiEt5LMU+fKUCvLsid pykLuvKjA+vhcXSsvf6Vm64ZMZ4LhZtPpXSs3HOSRpNtEGjKAPcNGNLNT0/P42QTTIkY lyoQ== X-Gm-Message-State: AGi0PubAxwhzE7H1O+k3GVlh7y/Tt1PQDuZ0b1tM27w5nIFfhlIGFJwb KyIUQTbt0nbmRSdvLFw+mECiTbujp51m9hdeE/EyIA== X-Google-Smtp-Source: APiQypJAEA33BzEaoDdpsA3Jq9hAyywjfm1wT9NK8LbQ/nxlTw8PDFtHYmJu1j4+YoOntu7u4ky01IJYJzNpFUcVn7I= X-Received: by 2002:a67:f582:: with SMTP id i2mr9262011vso.186.1585589882745; Mon, 30 Mar 2020 10:38:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 30 Mar 2020 13:37:51 -0400 Message-ID: To: Sara Golemon Cc: Benjamin Morel , Sherif Ramadan , PHP Internals Content-Type: multipart/alternative; boundary="000000000000b8782205a215e9fe" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Change var_export() array syntax to use short hand arrays From: chasepeeler@gmail.com (Chase Peeler) --000000000000b8782205a215e9fe Content-Type: text/plain; charset="UTF-8" On Mon, Mar 30, 2020 at 1:32 PM Sara Golemon wrote: > On Mon, Mar 30, 2020 at 11:39 AM Benjamin Morel > wrote: > > > If "they" don't care about syntax, then why do you? > > > > > > Sorry I was unclear. I was reacting to the argument about broken tests in > > php-src. > > I meant: they don't have *expectations* about the syntax, but they'll > most > > likely want to be able to read it. > > > > And we circle back to the current syntax being perfectly readable. We > could keep this up all quarantine... > > In a more practical example, > https://github.com/php/web-php/blob/master/include/releases.inc is an > example of a var_export() generated file that lives in the wild and is > regularly updated. > > I would say it's fairly readable, HOWEVER I WOULD AGREE WITH YOU that it > would be MORE readable using short array syntax and skipping the index > numbers. In fact, I had exactly this thought nearly 3 years ago when I > started touching this file regularly. (plus the fact that the structure of > this array is kinda gross). > > You'll note though, that I'm not championing making this file more > reasonable. Because it doesn't matter. Because accidental damage to > existing code isn't worth a minor bit of aesthetics by a file which is > primarily read by machines. If it really mattered to me in any meaningful > way, I'd write the dozen or so lines of script needed to output in a > "pretty" way. Or I'd go google and find brick/varexporter. > > Lastly, there are at least six RMs at any given moment working on PHP's > release. Can you imagine if we were updating this file using different > versions? The git churn would be horrific. Do not want. If we really > wanted "pretty var_export", then there'd be no real choice BUT to use a > library script to do the serializing. > > -Sara > I'm with Sara on this, which shouldn't be a big surprise. Just out of curiosity, is there any reason we couldn't add an optional parameter called "$short_array" or whatever that defaults to false? Then there shouldn't be any backwards compatibility issues. -- Chase Peeler chasepeeler@gmail.com --000000000000b8782205a215e9fe--