Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126022 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 DFCF31A00CA for ; Thu, 21 Nov 2024 10:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732186749; bh=SaBXRpfTrLzCiB3AEKEvUgn/SdezENIUGiJGh8fbLJA=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=f6sENP99KgeAt1HoZMnxAS6LF5dkqKvt0TflsugzFZ634FlUq2vbXWB1ve/PY1O3z rWcEB5EvzuFHYqfP0tfuMYDtf0oPpLrmNTInDFW5SgPgr/QC75OUiDSF8Qpo9yI0Tm P4ex4QeUeXd7tzCnzLa5cJ2uphADpsHpPGoAg5iYPKRfMEKo5t+NO7jHuQWzWXeTFm NzycKkrD2jZCXMV0GeAPrws/iE/C42cEuN8AYg93JTmpk1yKFYRPMO7BAtWT2DdIMQ PZA0ufEWu0JDe6VZNJfYeDrdu6XyawP2Mpu29nYRctfgclNR0va5pW7xOYeVbYspmM Mc3Lit2b68Pfg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A1D9180538 for ; Thu, 21 Nov 2024 10:59:06 +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_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) (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, 21 Nov 2024 10:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail2; t=1732186581; x=1732445781; bh=SaBXRpfTrLzCiB3AEKEvUgn/SdezENIUGiJGh8fbLJA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=N3nsWlM/wA6cxWfM9lF2i+6G6s6/GFViQoNL0jYVA4T0p8fEnwXBzZ3rUbaouMWlS 32K4YEsCecj7UwOKhf7NKQimO6MEBYvEerssXHVp/B8hih3b+GvKmyN977kjcvEABx r2h51SThX5IUF2KBT4RmqeNpAb8Xvs4awm4RS9EKfCT0UgXO4elnRQtEDbWtiC48CC w9Q107iLjdJrrfYt1Iqelyzycsl59WhebmwpC9niMsCpq1GLECxCyt+S8wBj1NjU1/ q7+wr0GSJX7bb9L1ZVQhI8dyM1qAGxAnQ7n7THEyn2oRRiQg+ZKPrjoU75TRqGSdi4 5PdAuyZe63Uug== Date: Thu, 21 Nov 2024 10:56:17 +0000 To: Christian Schneider Cc: php internals Subject: Re: [PHP-DEV] [Discussion] Make objects unpackable by default Message-ID: <0AUU5hqlTPa2cS3cb6pCTqbbQu6vz3NzuqjOgwbYyMjpu2fPSgql4BNsRqSCw2jGXH8vHPZKf7OBuvITs1mw815yXi6XfaN3M-mpXXH9cWw=@gpb.moe> In-Reply-To: References: <3dcc5393-6ce7-465c-abe6-ecb687b0f369@app.fastmail.com> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 583d4c989b04ad1e9b568e3ec2494223f8c2f3f5 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Thursday, 21 November 2024 at 10:05, Christian Schneider wrote: > Am 14.11.2024 um 22:27 schrieb Gina P. Banyard internals@gpb.moe: >=20 > > Agreed, this bites us constantly when needing to reason about what an "= object" is in PHP. > > Similar to array it mixes the concept of a struct, with that of a refer= ence value, and "overloading" various behaviours (e.g. iterators and ArrayA= ccess). > > It is extremely simple to go from foreach ($object as $prop) {} to fore= arch(get_object_vars($object) as $prop) {} > > and mandating this would resolve a lot of complexity, be that from the = perspective of what is "possible" or not to do, and from an engine PoV. >=20 >=20 > Is there (currently) a difference between > foreach ($obj ...) > and > foreach (get_object_vars($obj) ...)? >=20 > If there is then the migration is not always "extremely" simple, no? > If there isn't then we can simply define that from now on the former is e= quivalent to the second one and ignore future changes to visibility, hooks = etc. >=20 > My main point is that over the last years a lot of (for our code unnecess= ary) complexity was added but I hardly complained because other people have= other needs. I just ask for similar consideration in return when stripping= stuff. There is not, see: https://3v4l.org/T7tSu/rfc#vgit.master Best regards, Gina P. Banyard