Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125958 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 EBEBB1A00BD for ; Thu, 14 Nov 2024 13:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1731591627; bh=qb/ntp3PuXO8G6sWd6eWlcaqHK0mmLBOfv0skzjWA7s=; h=From:Subject:Date:References:To:In-Reply-To:From; b=fMICkjXcdKJebLkB5v8huqCgwLNNVAtFuqG0OczQ4STV6aKM29Zn+zEtGwdzRFjM/ IzKrqc5ZXz2jrY+cehMiaMDnKIcYz+043mvBw9QQMt+LMr9/d8hjNX+8BePsfay9Gj Tk5F6gBn8NMk6XyG961IDUy6gCSNQ3brUFEvu6+p7FGlXKSzhU9XaTTFn7cyrYDOyW 7MfjudTryN/596P2f36EydFRm/ls65EH3nvIFdzcLdzNVGogFD3JcDst2ewkPGjEga Q+X+MiJygtdp4PZjWhDzFldRIo25nOpkFqjZRXofJRSgiJORcDc04Xyl3EVBcMs/XM 3cRzD3wO44sAQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9D972180056 for ; Thu, 14 Nov 2024 13:40:26 +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, 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.gna.ch (mail.gna.ch [212.45.196.109]) (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 13:40:25 +0000 (UTC) Received: from smtpclient.apple (137.red-88-25-92.staticip.rima-tde.net [88.25.92.137]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id B509E3A0F39 for ; Thu, 14 Nov 2024 14:37:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1731591467; bh=qb/ntp3PuXO8G6sWd6eWlcaqHK0mmLBOfv0skzjWA7s=; h=From:Subject:Date:References:To:In-Reply-To; b=L9hnxUvKc7tw6wjFgCxyfBxlN8zkpFCRQT4hMqGj1E5kco/9oHD431eZiCgjmAKXp Sg9EPAKqSKzGmAYG8nvAyEq5GrGVb24Ef0RLASjacmQRdlhHF0mcqSmRAC9pjSJDVX rouHa/ODsjZJRdalzwcN3UxGL878qqyApcj5hhYA= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.200.121\)) Subject: Re: [PHP-DEV] [Discussion] Make objects unpackable by default Date: Thu, 14 Nov 2024 13:37:46 +0000 References: To: PHP Internals List In-Reply-To: Message-ID: X-Mailer: Apple Mail (2.3826.200.121) From: cschneid@cschneid.com (Christian Schneider) Am 14.11.2024 um 10:59 schrieb Marco Pivetta : > On Thu, 14 Nov 2024, 11:29 MrMeshok, wrote: >> Hello, Internals! >>=20 >> 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? >=20 > TBH, foreach on objects is already quite an abomination in itself =F0=9F= =98=AC It is a bit less weird if you use value objects or json data in object = form. I would be careful to judge how other people use the language, just = saying ;-) - Chris