Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121742 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50637 invoked from network); 20 Nov 2023 23:41:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Nov 2023 23:41:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D4C718002B for ; Mon, 20 Nov 2023 15:41:47 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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 ; Mon, 20 Nov 2023 15:41:46 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 367355C0813 for ; Mon, 20 Nov 2023 18:41:43 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Mon, 20 Nov 2023 18:41:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1700523703; x= 1700610103; bh=IMjdTWh4ELhUCkJTNwkVhVtNURyfj6oJZmE44v9uDOg=; b=x uL/zSwdQFYFSMoDrwviW/KroBsfFdju9ZiYsnIp/yk0TdSDyDebsHURfIsmNFspn 5s2TbanvwwekF3nfE7GwYNPcUDGjg41KjYAYqYp8XnQgH9ux//bApzQrztWhMnuU GUVCySOp7nhZFdhVMS+xKmAiIPuTXKDULq5Jq9VBPZNteVjPWjjL1FHVufgaDYvC USQLDi60AMzykKi/DpTpWy45sQt5wsfS9PCixItgLqvBcsg3rIAxY1DgStmLPWXm gL6WhgKmLk5PC4YgwwM2sJgL8wYAtyYc4L1HB/3yKZw9jbYwVplluSf8pEqzLIgh h20qo3gbyDWI7Yy+h9fDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700523703; x=1700610103; bh=IMjdTWh4ELhUC kJTNwkVhVtNURyfj6oJZmE44v9uDOg=; b=Z0Qb/zKRPc4fZ49UT/tb7jmv9PZn1 iSpD6bA2WhKcHIlqxRoJuTUU7yYeqSQzAMCUZUlN8aSNIggp1SfPrU8QLPa6zKsf Y0UL9a062Jt9HfyXcJd9v5bpg+tVWwG53BrNIaGjUh44pzCqNQyUsqvglUdTMbAG HthCBLxkyQ3iop8ImawxAzuFMQaLvkOieiA/1fipolHMLEuVaiAjgqlVGq7TouzW VMj3WuCcDYMEcaaVy+JbPZFPkpaPJSBrUm2eKJAZZOE3yXSsS8l2aKMPxoSm1BC/ oAovXn5IakF+b3VpT6VjLqcmJBqH7iPvPk9NYBg/QYsYvoc8LlzNfNONA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegkedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeevheehvdevjeelvdevgfelvefftdejkeelvdekgeeh fffgiedvjefhhfeltdduteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id CC2BE1700089; Mon, 20 Nov 2023 18:41:42 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1108-g3a29173c6d-fm-20231031.005-g3a29173c MIME-Version: 1.0 Message-ID: <4c5c9209-e797-49f3-84a8-f8c2371b34d1@app.fastmail.com> In-Reply-To: <054a1e3e-f860-4596-83a9-9f557c6fd316@gmail.com> References: <2b4591c1-f999-49b5-8061-67db816aa0da@gmail.com> <054a1e3e-f860-4596-83a9-9f557c6fd316@gmail.com> Date: Mon, 20 Nov 2023 23:41:22 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Re: [RFC][Discussion] Harmonise "untyped" and "typed" properties From: larry@garfieldtech.com ("Larry Garfield") On Mon, Nov 20, 2023, at 11:08 PM, Rowan Tommins wrote: > On 16/11/2023 20:41, Rowan Tommins wrote: >> Hi all, >> >> I have finally written up an RFC I have been considering for some >> time: Harmonise "untyped" and "typed" properties >> >> RFC URL: https://wiki.php.net/rfc/mixed_vs_untyped_properties > > > I've revised the RFC; it now proposes to keep the implicit "= null" for > untyped properties, although I'm still interested in suggestions for > other strategies around that. I have also added discussion of variance > checks (thanks Claude for the tips on that). Thanks. It's looking pretty good, and should simplify things considerably. > While doing so, I checked Reflection, and am unsure how to proceed. > Currently ReflectionParameter shows a difference between "function > foo($bar)" and "function foo(mixed $bar)", even though these are > analysed as equivalent in inheritance checks. Should ReflectionProperty > also retain this distinction? Was the possibility discussed when "mixed" > was introduced of using a ReflectionType of mixed for both cases? I don't recall any discussion of ReflectionType when mixed was added, no. My initial gut reaction is that both ReflectionParameter and ReflectionProperty should treat "omitted" as "mixed", and just evaluate their type to "mixed". It is in practice a distinction without meaning, or will be after this RFC. That said, I also have an itch telling me that there are a few small-but-important edge cases where you would care about the difference between mixed and none in reflection, and that I'd be the one to run into them, but I cannot think of what they would be. --Larry Garfield