Newsgroups: php.general,php.internals Path: news.php.net Xref: news.php.net php.general:328351 php.internals:122128 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24791 invoked from network); 5 Jan 2024 23:17:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2024 23:17:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1704496664; bh=fAdqWe9i6DzakxqE5/QXeSU/rDGuR7TAtGYS6OBfyXs=; h=References:In-Reply-To:From:Date:Subject:To:From; b=V5B4f5EO5nwCdoBe0MSh7ayLaKj40pO3lli25QfMTW1t24E345d9wVF5KNPNpKqGM ImujgdAOYZZJ/Ckc8FeaCDJ9vAbHlcdMTz9bRIp+EH8bbhaPLLSP0WNU4ZQgLwKc1k vblMsYftuWEDHxVNEeTrcTuSyY0+VnNmf4dwmQFbZuO6ShBkvcRagyOlv+tJ075vo8 NTaYmfUM53L2aZVmBf6xd+mm1oCu/uHfuaBQIixkXHsNT4SQORlVbTjSThTJwCPyHD BqTE2EvMrcziZbKyFWM1kzGpdpJ9Cmo+H1jlKBcklzhIAqUHR9GljGTPRhgygsd+mw 86+UG53671slQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9DEDB18004D; Fri, 5 Jan 2024 15:17:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS; Fri, 5 Jan 2024 15:17:43 -0800 (PST) Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-dbed729a4f2so52377276.2; Fri, 05 Jan 2024 15:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704496630; x=1705101430; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=x+NcuwPqsFT4o+mpqOBwkQxNUGbL+VljkUaf6G/RGRA=; b=VVh/Wy834D286QWi6Vt061ViE4X16CjETqz50k3lf+ZlUKdD40//jrIT02RVotmWbq nDxyeOD6k0x5+ZSG+/Fx7FSzU5L+BACSq2TEn/BbAxxDPogEiVtYLwBupaCPTJ7armoe gl+3ie+vDCkgAWFnZE3Bb8KnSP2o8h/O8TLQhiRlwAv7DzSKkTeV/CYcQK8pI8I7RzwQ QIJ8WWJwaIYqtnmxiFw9tfgQPoXtgfdO3y4BIStzfB1Ezsy/2+wj0cmqfOuqhrySrHd/ nsTpROnwEWidoa+kghsuJTwJl9P39p4Qf0OUKIOpahozYEOb9sgDjVXoQej4/ds7e9Ds vVFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704496630; x=1705101430; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=x+NcuwPqsFT4o+mpqOBwkQxNUGbL+VljkUaf6G/RGRA=; b=RzT6xzZNYjXk5Rxl3TsMIvBAt690/aK96Felr3uCut4kPHGgzRQtS3GJoroRHf+Ne+ 3xLeWCApu8Qra59AVe1kOtXluqby90YK/3U+EOM3ZmnpzX5TqbFZXKgwDRPmFu/jrzsZ zaNWkR/btuI6JM30rtP8KKJ62IS7lc9wV10hFdx3k86L9QaCpQbviIzhnC+PlODYuSnN qqiBjGBbRko6kK2jpwmnkadgKDUEEaZq/00GH9j3yF0Wy/Jf2rFBF/jGSyitU8iuqm0c ldsSsUrJNQTdGc0oXq/8FRMSgrxbFBk96sn2jsXI5Qx5Unxqn6M/D3vX/CyacxTZ/nM8 Fvdg== X-Gm-Message-State: AOJu0YwrKOJVA4RTj8Q1EtC9XIgYwDOIaMHcQw4/0ZYhTNtjpnpPym/A NGCL68rNmOuI/xST4KbfAM9XVMSt+BvVnyyXVDDu3olm X-Google-Smtp-Source: AGHT+IFZpZbs5zxaYxbIZJVR+3yIRU0CgU0g/lsoEDKd4rLvP2GYcXIL6Uht8jiH/1u3k6RuNIJ2CH6jS1zImyyg/vs= X-Received: by 2002:a25:adcb:0:b0:dbe:d284:dbdf with SMTP id d11-20020a25adcb000000b00dbed284dbdfmr88395ybe.16.1704496629958; Fri, 05 Jan 2024 15:17:09 -0800 (PST) MIME-Version: 1.0 References: <4B81D2EE-0A84-4443-8F32-5D27AE43954C@gmail.com> In-Reply-To: Date: Sat, 6 Jan 2024 00:16:58 +0100 Message-ID: To: PHP General , PHP internals Content-Type: multipart/alternative; boundary="000000000000264ee5060e3b0c6a" Subject: Fwd: [PHP-DEV] clarify the destructuring list() concept From: glash.gnome@gmail.com (=?UTF-8?B?TcO2bsO0bWUgRXBzb24=?=) --000000000000264ee5060e3b0c6a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ---------- Forwarded message --------- De : M=C3=B6n=C3=B4me Epson Date: sam. 6 janv. 2024 =C3=A0 00:15 Subject: Re: [PHP-DEV] clarify the destructuring list() concept To: Rowan Tommins Le ven. 5 janv. 2024 =C3=A0 23:31, Rowan Tommins = a =C3=A9crit : > > I'm not sure what your question is I try to follow the procedure of: https://wiki.php.net/rfc/howto It seems to me that list() is not clearly specified. I wanted to know your opinions on this. For example : $key =3D "a"; $value =3D 1; $array =3D [$key =3D> $value]; [$key =3D> $value] =3D $array; We all agree that now $key =3D 'a' and $value =3D 1 And I wonder why What happens in this case : [$key =3D> $value] =3D ['b'=3D>2]; $key =3D 'b' and $value =3D 2 or all is null ? Le ven. 5 janv. 2024 =C3=A0 23:31, Rowan Tommins = a =C3=A9crit : > The name for this if you want to find more information is "array > destructuring". list() supports destructuring assignment for arrays. Do you have an opinion on object destructuring ? *Do you think seeing list() as the reciprocal of a function call is interesting ?* Otherwise, how to use a default value, type hinting, nullable/optional variable... It's not interesting ? There are many things that could be done with but don't work. For example : $array =3D [1, 2, 3]; [...$values] =3D [...$array]; My question is: I see list() as the reciprocal of an array(). Do you think it would be interesting for everyone if I proposed my vision? --000000000000264ee5060e3b0c6a--