Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125957 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A59D01A00BD for ; Thu, 14 Nov 2024 11:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1731582168; bh=2n5bD2oUPZukWellwWjak82rQjOW7YzP25pH7j7miaY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dIxGaou3c6GPFKbWTosA545vUyLGjvLsji7g1cGeLEtKS3OfAgENyB6nc4zxqYHnx J/b95wG/qfpHxprm0pUYGMLJPGM4HTgyV9FFr5gUPZTIj2/P3VtuxK/dLcZhDUakiv yLU9RrGJxqs2Yf1Ec6ZzAmKRTepWVYNmqii0DKcfT0K9wzLx/ygTAuAy8lJHodl7YC SKC15JbHrTOv0KjWpIH6N9PHgjDt+3CvmcCcnhRCoP2r2xbSfcngam+lr7cNnJE6Vw qas7KL2fuI244k5wkO5hgsly/uDHpE/MKqZnWTYqbE37ZVxQd89Fclx4Xhe+FM0rN0 VFJtlYxqO818A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 689F518005B for ; Thu, 14 Nov 2024 11:02:47 +0000 (UTC) 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, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (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 ; Thu, 14 Nov 2024 11:02:46 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2e56750bb0dso385234a91.0 for ; Thu, 14 Nov 2024 03:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731582007; x=1732186807; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2n5bD2oUPZukWellwWjak82rQjOW7YzP25pH7j7miaY=; b=Ysq88ZXm1lBnYSbL3CAwz60VHelex8ABny/qR/BBmvb0bVlJQHu47ptNTFU75EIlmc 8/lCAFDQtB0e/e3N0NffEoUx0pTupe6cNepg6w3+b6M9JLh3yZklHqIYRN2VUiBHbnXf flUCH8EVjn1Ug8NFz00f3Brn6VDw8KPTTt5q6awt2xBj5i+t/AjxhfYY7poXoWRnz/95 ql0YEXvkzmTkZqkDI+bUlj0gx4byrulhNQB2BFzTd9cXnJKVquGA8zxZ2f+eA8OqNnCA NsJbEzEIrdwBsowFzHGsVDFYOpZqE8j72jbmgtHJilhxIxuHn2SpMUBFXrfRotyl0Ifg +A7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731582007; x=1732186807; h=cc: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=2n5bD2oUPZukWellwWjak82rQjOW7YzP25pH7j7miaY=; b=tsPYeo1ki4LFL1L7JXc3WQDgc6nulCG7gvX1mSnskSwBqk5Xy/FEewx7LP56LwvuuC wOI9ZjxuM6ofPgkHUc2yo/ThoC6hs/gXysPFDwdCP6qMtUashQ3eDmlCrikheiDDt2tm OAZs9zM69jaVEDQmaY2JkrOmAc1MkS89IPTzNFrDuzYa4TX0zLEe0qvqJeSG/63Uz0ap tOVBnanhApG3pU7r825n6pZCbNEeVzeo0dxd4YTgDZk1Ifn7BLxNqhHRRh0Z/LH+e5eL DP+KIcgQAVCeLFLZiuwb545J4F/qlQLFDvcFpxeckd3jK+GXZIZTTSaCkrBbXgjMhZwu lEGw== X-Gm-Message-State: AOJu0Yy4xKPKj0PPxEn6nxcSCMsR3qE3Yy6ItPnqoOT++3E6ipc8nyv0 MhYiqBUUljCmao0ZZDAE3Y15iHohVemuJe2G54wtJXYjxxyyJCrInVkDibwW/5bT600ju6REtzb Fc+UqEuTzt+ul31gVVJzUCdlv8n4= X-Google-Smtp-Source: AGHT+IHTM6Bg5DZC/l2Nq0D9FdXxR1Nu1dbA9OqasP0qhc8SE26fFRdirZw7F2EbYGfsu/8hDaAlnvg1QfsLKjsl1O0= X-Received: by 2002:a17:90b:4a84:b0:2e2:8bce:3d02 with SMTP id 98e67ed59e1d1-2ea0639be01mr1818302a91.30.1731582007093; Thu, 14 Nov 2024 03:00:07 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 14 Nov 2024 11:59:54 +0100 Message-ID: Subject: Re: [PHP-DEV] [Discussion] Make objects unpackable by default To: MrMeshok Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000006eb81a0626dd5a7d" From: ocramius@gmail.com (Marco Pivetta) --0000000000006eb81a0626dd5a7d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 14 Nov 2024, 11:29 MrMeshok, wrote: > Hello, Internals! > > As you know if you try to unpack a regular object (`...$object`) you will > get an error: Only arrays and Traversables can be unpacked. > I don't really see a reason for this restriction, because foreach on > objects works perfectly fine, so I made a feature request on GitHub to > change this behavior (https://github.com/php/php-src/issues/16038) and > was advised to see opinions on this here. > So, what do you think? And does this change require RFC? > > Best regards, > Ilya > TBH, foreach on objects is already quite an abomination in itself =F0=9F=98= =AC > --0000000000006eb81a0626dd5a7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, 14 Nov 2024, 11:29 MrMeshok, <ilyaorlov124@gmail.com> wrote:
Hello, Inter= nals!

As you=20 know if you try to unpack a regular object (`...$object`) you will get=20 an error:=C2=A0Only arrays and Traversables can be unpacked.
I=20 don't really see a reason for this restriction, because foreach on=20 objects works perfectly fine, so I made a feature request on GitHub to=20 change this behavior (https://github.com/php/php-src/iss= ues/16038) and was advised to see opinions on this here.
So, = what do you think? And does this change require RFC?

Best regards,
Ilya


TBH, = foreach on objects is already quite an abomination in itself =F0=9F=98=AC
--0000000000006eb81a0626dd5a7d--