Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114992 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58894 invoked from network); 21 Jun 2021 20:45:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Jun 2021 20:45:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6504D1804C0 for ; Mon, 21 Jun 2021 14:03:40 -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.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (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, 21 Jun 2021 14:03:39 -0700 (PDT) Received: from smtpclient.apple (unknown [IPv6:2a02:1205:502d:fa80:15f:3988:4500:e76c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 737811517D6C for ; Mon, 21 Jun 2021 23:03:34 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Date: Mon, 21 Jun 2021 23:03:33 +0200 References: To: "internals@lists.php.net" In-Reply-To: Message-ID: <4039DE1C-996B-4AB0-B211-F626142F356C@cschneid.com> X-Mailer: Apple Mail (2.3654.100.0.2.22) Subject: Re: [PHP-DEV] [PROPOSAL] Bare name array literals (again) From: cschneid@cschneid.com (Christian Schneider) Am 21.06.2021 um 18:54 schrieb tyson andre : > return [success: true, data: $data, cursor: $cursor]; > // is equivalent to the following, but shorter: > return ['success' =3D> true, 'data' =3D> $data, 'cursor' =3D> = $cursor]; Just a little side-note: A while ago I proposed a 2-line-patch to allow = :$foo as a synonym for 'foo' =3D> $foo. This allows for return ['success' =3D> true, :$data, :$cursor]; which is both shorter and removes repetition while keeping the variable = usage $data and $cursor visible. I know that this has been shot down before but I couldn't resist = mentioning it in this context, sorry ;-) - Chris