Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106683 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32415 invoked from network); 21 Aug 2019 09:25:07 -0000 Received: from unknown (HELO mail-oi1-f171.google.com) (209.85.167.171) by pb1.pair.com with SMTP; 21 Aug 2019 09:25:07 -0000 Received: by mail-oi1-f171.google.com with SMTP id h21so817260oie.7 for ; Tue, 20 Aug 2019 23:55:27 -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=X3FGGSVWDXscptII1/N8An3Lz+WQ0vFDiJSnBzYztAI=; b=G2nESvJL5AzBdg+MaK/h9GuKhJcwd/zoSy2Pszl4ondvOh9JozwxD26XniMW+3/RCG zBolByaFyjFspNJ6lAu9rrjD59iyR+AagaUj9Xi2pookXV6pb2Lifmz4hCotA3otjOCx AjGyiCOQ6Kjbj4I9fMipPYZVGhkMjjei7rPvLl+MqTPPAvdS7t3819hxZSZupXQwPaUM lWU9+P+8kBVgEH3r97eUS26yli9C19QKOLCCRJbnN1S+zqlinmUCGc4TrEAk7SlfqVIb Ewe8vOoDg0x2fbm2Peoyro8M+svoPwgHJ64HVZ8NEgxnpZe75/H5PqXKsHuT1d1QQjuA QYYQ== 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=X3FGGSVWDXscptII1/N8An3Lz+WQ0vFDiJSnBzYztAI=; b=iCHr7IncZzVZZWcvsvDufnzPvK1q//w9Ba/dmlpzUKxucXS6bPGmAsRdYNmHDTi0bQ DaImOF0cs6ggbbigbktzeN6w8oMcnQ7w4acxuw6tatizjhr0xCAwmKvLNblEVRhGSe+z 2yLg6s2l85y0nN7m6Vt5HnsZ6zdck68dvzfaJ+SWplYq+NT1lGxuHVbvJSaBj9QrSaGV d3UCK48BOLlAV0Xj/OMPdk700qBMuQVtMdkYM7aMjDAqxPQ5KMYlNL9YirCoKZJhTyxQ EzyXdmidGlH7Rw4IV3gOsN8fb0acjST2qhn5klKHk/VTFditYZfbyfGinCzLNkkBTImr MCoQ== X-Gm-Message-State: APjAAAUJckt0XNug1lGv7GCo93kN5JsaAOkkSF1C1xyMoh+jluCTe0fx 3faJa0ubXT1kqSOqFpLja2k5Edd8fKcDRTVIPuk= X-Google-Smtp-Source: APXvYqy6YUNJPQaV72BRxDl+hP5iVVqOFBjAhzJdNRiO0/TOuzmcnbXZMpKgnFzC/uTQUDhfQWsUQ0qnlJNxnX9Mbd4= X-Received: by 2002:a05:6808:8da:: with SMTP id k26mr2690544oij.178.1566370526492; Tue, 20 Aug 2019 23:55:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 21 Aug 2019 09:55:15 +0300 Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d17cc105909b0e17" Subject: Re: [PHP-DEV] RFC: var_export - short syntax for array From: vamakin@gmail.com (=?UTF-8?B?0JLQu9Cw0LQg0JzQsNC60LjQvQ==?=) --000000000000d17cc105909b0e17 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the feedback! I will back with improved version of RFC. =D0=B2=D1=82, 20 =D0=B0=D0=B2=D0=B3. 2019 =D0=B3., 23:01 Sara Golemon : > On Tue, Aug 20, 2019 at 1:05 PM =D0=92=D0=BB=D0=B0=D0=B4 =D0=9C=D0=B0=D0= =BA=D0=B8=D0=BD wrote: > >> I would like to propose a little change in var_export function behavior. >> For today, this function returns string representation of array in old >> style with =E2=80=9Carray=E2=80=9D keyword: >> >> var_export([]); // array() >> >> I think it would be better if the function returned array representation >> in >> modern square brackets syntax: >> >> var_export([]); // [] >> >> I do like the idea of doing this, and would even be generally okay with > just making always work that way since the introduction of square bracket > syntax is really *quite* old. > > The only people I could see being bothered by the change in output would > be automated code-generation suddenly seeing a (potentially quite massive= ) > diff as the bracket style changes. As an example, > https://github.com/php/web-php/blob/master/include/releases.inc is a 10k > line var_export() generated list. I'm actually /not/ bothered by the ide= a > of having a big point-in-time flip of that structure, though I'd want to > make sure all RMs switch versions at the same time, otherwise it could ge= t > noisy. > > Perhaps an option to quell any dissent might be to add a third param > $options to allow controlling this behavior. > > function var_export(mixed $data, bool $return =3D false, int $options =3D= 0): > string {} > > And you could either pass EXPORT_SHORT_ARRAY or EXPORT_LONG_ARRAY or > whatever you want to call the constants depending on which behavior you'd > make default (and honestly, I think we'd make the existing format default= ). > > -Sara > --000000000000d17cc105909b0e17--