Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109468 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38907 invoked from network); 30 Mar 2020 19:17:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Mar 2020 19:17:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BEB7C180552 for ; Mon, 30 Mar 2020 10:42:58 -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-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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:42:58 -0700 (PDT) Received: by mail-qt1-f170.google.com with SMTP id c9so15848859qtw.7 for ; Mon, 30 Mar 2020 10:42:58 -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=ZLwW/Z9Q423YNPH14nXb4UgjIx2ogdL40A8QRyVevzA=; b=nU0GllUT93oFTpQIY2QyDSgkCP0oX2cGBT0fr0e81nXSYGXPGRyaVmEB58UoSQLlPM usa/yWL90PW2xbhZVhqF6gh6I3ih5VbdqypDg8iGdZneD0PwvL0VR8aq0DQDlr/D5A1m r9qRf+L8+PeH0vX7XlVaXiB4kK3Qm6AOQDchnPY074xv1dKDRREDTtiexTymGoMHQqhC foYZSY1tZzBWw0xbe2nSq0m2hGOBvLNnDXYFrTGvWuy6v6eb6kPh5Fjl/U02E0v8RP95 Fu3c9Eby63LkHSRisN5NuFN7UFeI1KC4TbiqpBM9N6tYIFLfN3j4xNZNcdUuSMgLRmL6 /iRA== X-Gm-Message-State: ANhLgQ3+ImfKIvLPb7bbImDaaC23fon8fxFwUtvHfjICPCAbYMvTCL50 SitfkJ2+VMMTVOyEj1AhPdkc8sEOzafpiGoGw3GmSQ== X-Google-Smtp-Source: ADFU+vvLxfbXvTdwe/cjCEsi57rpZSaS4HVavoK0lcTD+nnVUAvpGqQQz89zf1Mq5XlOiXwRgx0tk70ZrJpU5a2L/SE= X-Received: by 2002:ac8:2aef:: with SMTP id c44mr1201296qta.116.1585590175384; Mon, 30 Mar 2020 10:42:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 30 Mar 2020 12:42:44 -0500 Message-ID: To: Chase Peeler Cc: Benjamin Morel , Sherif Ramadan , PHP Internals Content-Type: multipart/alternative; boundary="00000000000029da7b05a215fb3d" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Change var_export() array syntax to use short hand arrays From: pollita@php.net (Sara Golemon) --00000000000029da7b05a215fb3d Content-Type: text/plain; charset="UTF-8" On Mon, Mar 30, 2020 at 12:38 PM Chase Peeler wrote: > 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. > > None at all, though I'd make it an `int $options = 0` similar to json_encode(). I'd have a FAR easier time supporting that than a wholesale BC break for the sake of breaking BC. I can think of a few options: VAR_EXPORT_SHORT_ARRAY => use [] instead of arrray() VAR_EXPORT_NO_WHITESPACE => Keep it concise, single line VAR_EXPORT_NO_VECTOR_INDEX => If an array is vector-like, skip indexes VAR_EXPORT_UTF8_UESCAPE => Detect places where we can use \u{1234} syntax for UTF8 strings Though I'm going to stay with my stated position that I would MUCH rather this stuff live in userspace. Just because PHP's penchant for including the kitchen sink is broken already doesn't mean we should break it more. -Sara -Sara --00000000000029da7b05a215fb3d--