Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109548 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44550 invoked from network); 7 Apr 2020 12:46:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Apr 2020 12:46:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 983611804CD for ; Tue, 7 Apr 2020 04:14:47 -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_H3,RCVD_IN_MSPIKE_WL,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-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 ; Tue, 7 Apr 2020 04:14:46 -0700 (PDT) Received: by mail-ot1-f52.google.com with SMTP id a49so2636242otc.11 for ; Tue, 07 Apr 2020 04:14:46 -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=py8wVbenHMPrHoKX804Zj197ahm0ur444odQt03IxN0=; b=fqWxm0VbXxkc9qVbzN5A2G//kNwGCGINSrsb1faoTRAEHxCZCY0tP6i2pU+qauB2QZ IaULdyKFFetvzUTE1m0l87VRHQGrwPAx3mqNaHXz3YizIcNLVkAR42ES/ZTtt7ooUoMK P3UwUyRoEdsh1TEY4fF0B8K7/xm9g1+uLLR67ey2z3tBB/Cu5QBvKjIyz2SlXattEWVx zXtg0q8p0o2+MKLt25qmqvFfcYd1fmAe8r0Zz3Zvp7fZRZ/yabJXsrmKwwNgW6ZyzZR3 78+l3/f9+LQ68AHApHCRP11iwLsc7iD8YZSB1sQd1DztRxToKscrN03vuW19hMbu2HZ7 8szA== 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=py8wVbenHMPrHoKX804Zj197ahm0ur444odQt03IxN0=; b=bborpoxTWZoMl6KVhP1LJt+rSJ8H4PU7kJmb2ajqlwZX8ODzY1xPbPtMcms87bZJrV kh4mGhje2ERbk/cFdy7H5v0h1BAFXodj/h7ib6xTraycMaM7HeVOvIQ4gU/W5Xi/UauC 7DzvEbtQkr0yaXYss+6+/kFqEtV1QqcQIwSA0h6RVpNdfyM0ocrX/SwwyV0zR7J6qHie pGbM4HB+hH2QkBRasYNB5cR209jVGeH92gtAPxpHNsSTq4NO5yJIpPN6rKgnM+X0xCEZ Xsn5zysWX8ulwCASxS/bfyhtgaHDajoDTJ7t5QpeQYC7Ak/LWrpCsuZOC43YP/mjb9Vj s2OQ== X-Gm-Message-State: AGi0PuZ+tycX449koT5vVlWOjHBKlvyVyVS/tMbumlVDxE07nddaU9PB PCOjQLiniVEkzqJe6frIpPIr1tiqHnHTllQYknY= X-Google-Smtp-Source: APiQypKXcNOdxjLTMLhZV+sda5XeFv2XqJzIAhKlnDOq36/sH6fAIlxV3TpyvE377Edqq5ZwNIRpT8t/XGfgIY6V3UQ= X-Received: by 2002:a05:6830:1190:: with SMTP id u16mr1119516otq.83.1586258086139; Tue, 07 Apr 2020 04:14:46 -0700 (PDT) MIME-Version: 1.0 References: <59e48d22-6d2d-19df-1b4a-cb2e7281ceea@web.de> <400d7cec-527b-1bae-4939-17c936b0c018@web.de> In-Reply-To: <400d7cec-527b-1bae-4939-17c936b0c018@web.de> Date: Tue, 7 Apr 2020 13:14:33 +0200 Message-ID: To: Enno Woortmann Cc: PHP Internals List , Levi Morrison Content-Type: multipart/alternative; boundary="000000000000bf1baa05a2b17d94" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Type casting in array destructuring expressions From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000bf1baa05a2b17d94 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le mar. 7 avr. 2020 =C3=A0 12:07, Enno Woortmann a =C3=A9crit : > Am 25.03.2020 um 18:53 schrieb Enno Woortmann: > > > Hi, > > > > I've written the RFC and implemented a first patch concerning the idea > > to allow type casting in array destructuring expressions. > > > > > > The RFC is located at > > https://wiki.php.net/rfc/typecast_array_desctructuring > > > > The patch can be found in MR 5296 located at > > https://github.com/php/php-src/pull/5296 > > > > > > Thanks for further feedback! > > > > Cheers, Enno > > > > Hi together, > > As there has been no recent discussion concerning this RFC (tbh no > discussion at all, I don't know if it's like "ok, cool idea, just let's > do it" or more like "oh no, let's forget this asap") I'd like to start > the voting tomorrow if there are no further comments on this proposal. > On my side, I like the idea but the proposed syntax looks weird. I would vastly prefer (and upvote) Levi's proposal: [int $a] =3D [123]; // note: no brackets, this is a type declaration, not a casting operation [string $a] =3D [123]; // TypeError or implicit cast depending on declare(strict_types=3D1/0) in the file Nicolas --000000000000bf1baa05a2b17d94--