Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122127 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22075 invoked from network); 5 Jan 2024 22:31:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2024 22:31:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1704493931; bh=N00UWupa4ixUi34MmhbJFMZE+M6io6yhIbPOly/dRWY=; h=Date:From:To:Subject:In-Reply-To:References:From; b=aGqZ3xPODFCChlFuUzEWXV4gyj0EI3eAR2WgUY/VIDg/CsnZl/v53Y0VuUKoFS0xg 98h8LcvT9TOtJKYK6LLvsGSPFdaNECVRIHXvxlRdXNYtGy1HMzbH6ttv0IO0QqEWJh biep9Jlff3yPYluwWZSSUI+qJ5SdOsbbcN9MT9yQZxLB/GYSO8ekOmOmIyut5LWkNr GXH3m5LcRt+a6LN3dXT6yMJ5gEA/MGdT+whwAdLRZb4IYSTkLcKfrKKJMCNgQfpnZs dS/qseWoiCkbREMa3b/XeCo9KYCewee4Ij1uzKvru4Xo+gJgbeUCYbZpuCjv7SkfnR 67zoiUTOVTmnQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E451A180059 for ; Fri, 5 Jan 2024 14:32:09 -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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 for ; Fri, 5 Jan 2024 14:32:09 -0800 (PST) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a1915034144so2941266b.0 for ; Fri, 05 Jan 2024 14:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704493896; x=1705098696; darn=lists.php.net; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=N00UWupa4ixUi34MmhbJFMZE+M6io6yhIbPOly/dRWY=; b=VEGc+AMinT6e20h8W5qERTtp+Kj8vlZ0nPr4RVqw8sPwXFnXVjokBFmaklYoZ841sO IqHcbruu79Wzata/MU8+NkoTa3ViaUdTouGQgn9Ly1PQMtsP1xi/hgSgHWJhm2PklDNC 5Pj7U5ZVZuIbjgJ3g9N2xFN3NQ2GzYfSiHVHk9C6qNldD15r4X+BwOxhvkk5BMxOjTnA TQbe0AbTUjOQmwW1iUhQcRk11vqanbIE2Ji455XMxNfUXcnBfBUdQlYKrl7S4SfKfwhc 0tmrTLNkBTRY9t6EY/ItdVylanQxoRMXNaaU9joDD+RCJcRqvDKxs9xQrr6ljVqi32l7 HKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704493896; x=1705098696; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N00UWupa4ixUi34MmhbJFMZE+M6io6yhIbPOly/dRWY=; b=L++QAaTcILYxVxzJ3z/TFTWOU7L7IkleqCFHhkPwc71NvRE6UHo4xYScOpI44wLhCU VzD8/VayX18ukajLYfLptdu7CyCvdFsShUqz3awIhrI1vrlmYovCCgIxd9wm45O9XHea dc6CNtmC62SX3sMYHDJbio5NPN0uD8mgUFcqgnQMW3KJ3Z1b0HSivgQfnnFgtUg25C0m lrTP4Gem4lQbEZbUoBH9FAfXftqK2VjL2AZVnCNPFHQ7cXc7ZbIeGqlaZALu2vGJRoVb n/Jsk+Oh1U0Rex5RiKceGKVYDKyb4BHu2f7I4UCRGG8jp9dMvP+0n3tdHa98Z4484rz+ m04Q== X-Gm-Message-State: AOJu0YwWGuCMUhtYhk+m20VP4I9ezt5B/ffqUhs9Jxy/voszdpXDhN1y 8eaMtSxoHW167b9ktkxKrIKOFSm9YFc= X-Google-Smtp-Source: AGHT+IF8JzJgrRZVWMKAHigicIUEvIiDPdgNz9552M5PjeHOtDknxYOHhQ8lBT66A/NYiJXX4BhaRQ== X-Received: by 2002:a17:906:a0ce:b0:a26:e75c:cf7 with SMTP id bh14-20020a170906a0ce00b00a26e75c0cf7mr25670ejb.139.1704493895763; Fri, 05 Jan 2024 14:31:35 -0800 (PST) Received: from [127.0.0.1] (92.40.197.124.threembb.co.uk. [92.40.197.124]) by smtp.gmail.com with ESMTPSA id r9-20020a170906c28900b00a28d2e95152sm1302007ejz.129.2024.01.05.14.31.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jan 2024 14:31:35 -0800 (PST) Date: Fri, 05 Jan 2024 22:31:32 +0000 To: PHP internals User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <4B81D2EE-0A84-4443-8F32-5D27AE43954C@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] clarify the destructuring list() concept From: rowan.collins@gmail.com (Rowan Tommins) On 5 January 2024 20:44:00 GMT, "M=C3=B6n=C3=B4me Epson" wrote: >Hello internals, > >> The purpose of list() is to assign a list of variables=2E > >What should be the underlying concept behind the list() language construc= t? > >I propose that list() is the reciprocal of array()=2E >That is, if array() is a function call, then list() is the signature of a >function=2E > >Do you agree ? > >Regards, Alexandre > >PS: For historical reason, i propose to allow to syntaxe : >list(name: $name) =3D ['name'=3D>$name];// maybe discussed >list('name'=3D> $name) =3D ['name'=3D>$name]; I'm not sure what your question is, but the second option, with =3D> as in= all PHP contexts, already works: https://3v4l=2Eorg/dqgal Note that neither array() nor list() are functions, and both can be spelle= d [] as in=20 ['name'=3D> $name2] =3D ['name'=3D>$name1]; https://3v4l=2Eorg/Uu5e4 The name for this if you want to find more information is "array destructu= ring"=2E Regards, --=20 Rowan Tommins [IMSoP]