Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109463 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31476 invoked from network); 30 Mar 2020 19:06:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Mar 2020 19:06:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 248BE180503 for ; Mon, 30 Mar 2020 10:32:49 -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=1.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL 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-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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:32:48 -0700 (PDT) Received: by mail-qt1-f177.google.com with SMTP id t9so15787544qto.9 for ; Mon, 30 Mar 2020 10:32:48 -0700 (PDT) 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=sBiDFq1yrr6TAEVzxWMSQMov3gQNoAjwOTypfq+kUYA=; b=Neyv84v1wChrrHBihr+dM2PqTyEyJVC7oKOWeGMFGedQFFIKevZD1gw4cWHXCiyI6P 0XPSyiBW+L30bKexg13ckYNx3UMukCPL5EaZcQ9Xx2g+5RxtsoYYWojspCRTcwOy9S7c 4JcVwlIgzrgt86yB7D3W5S3EHcLE/5fOgd8cIlH4zT2logAMCECcQyxgGAmx25T8DcR8 FhN18qMQb9twyzFvmKVgoNyyNS5RwzsC6+cFDTBp76ivOl8i6MaFYYW3lfYFyxBma7Dn QPd23G+QPyek49FIJc2CbMrDg/VASMRe/BUwuXE43OBA6fhdYsErO4LVQkySRIlbVyUh Km3w== X-Gm-Message-State: ANhLgQ1plvCZ1tErlYi0N6n3sf+AjtFfsKcha5isi5PSL4gY1uzE/A2Z XnErGnTmmBVRcZFIBYn3nw6LuyNtFIQVXsfMuY1ECQ== X-Google-Smtp-Source: ADFU+vvvjRAdF/X1HT8aT2o/ISNQJgykJLXMBymazbbnZOjDpkQC6J9qipwPm9N6r8+DnrGUlZqyZCZ7gPCZvy/ED84= X-Received: by 2002:aed:3eec:: with SMTP id o41mr1085472qtf.343.1585589568039; Mon, 30 Mar 2020 10:32:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 30 Mar 2020 12:32:37 -0500 Message-ID: To: Benjamin Morel Cc: Sherif Ramadan , PHP Internals Content-Type: multipart/alternative; boundary="000000000000f68cae05a215d649" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Change var_export() array syntax to use short hand arrays From: pollita@php.net (Sara Golemon) --000000000000f68cae05a215d649 Content-Type: text/plain; charset="UTF-8" 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 --000000000000f68cae05a215d649--