Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123122 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 96F741A009C for ; Fri, 12 Apr 2024 13:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712928493; bh=bYI574fiV8G11j6nOpQYnAQg3chZIR1zJIrq2PRyFks=; h=Date:From:To:Subject:In-Reply-To:References:From; b=EiGwogMZ1KGHxaEc7KlvvN0Lm/5C5oqhPeAZ5U/OyjgVDVnTkLcA2rMekioJVAam5 yUnFCLpt+AZhZeDMbE0wgY2htJTu9++215ejGaN0CV5lAFx34jg4uigushKYVTfFFO ApIVL60MoMZu4idas9chYJ4xSEFCdHkIX3sBMDrNb1CmWEo2LEpHZlO9LZOT7TFTXG KxVb4rj4zUqfz/+LwcNfnSZygj7vQclvSNDeErAl6gh0N1ZuNYjAxekohiMb3wJpxz tnM9XLbeAcPDlQ3ICzh6bNXW43i/CnB8LLnmLfdmhHfAb+8WeQqwcr3Bfsuzklhdwr VMG1br0EAIiNA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F2158180571 for ; Fri, 12 Apr 2024 13:28:12 +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_MISSING,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from wfout7-smtp.messagingengine.com (wfout7-smtp.messagingengine.com [64.147.123.150]) (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, 12 Apr 2024 13:28:12 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 7A1981C00146 for ; Fri, 12 Apr 2024 09:27:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 12 Apr 2024 09:27:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1712928455; x=1713014855; bh=bYI574fiV8G11j6nOpQYnAQg3chZIR1zJIrq2PRyFks=; b= XyTDenDgTYsF+74aAYsrQIpG/QpV4nn352/in9+m+cJeS7N2p0Q6VXqpHdtZuFfm h02JBYK8vPqI65ZUvtRvVHvhCn8CfEZH/e4jRGJUo03paHAZoMH3Ch5IBQ5wJBvv v1ftMc3NAMKrBHOB0qoSAUh+J81DUJgubTEtTqCHWwr1NQ7QlsTTkSxrczKvEBMM +ZQjAs6cPw6i8DKtLFei12ieoG7w58nP++Td+Nch3H4f06qO/Mv83UxVSYy0Ud4r b9zaY6wru1hiyvUiWN0lTwHWNlwDDISkiZPJy7+W0aaWbtYtFe/7PHe3KSCH61uY nHIfxwFrdxM5NHWARZryag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712928455; x= 1713014855; bh=bYI574fiV8G11j6nOpQYnAQg3chZIR1zJIrq2PRyFks=; b=v ViIm+vMkdBtNV9snuZY0IX1U+TE5CNGrt+ZttbDB/JcIkpiPb+cZUqVI36LpyZbq P0ndxmUOabumLDthvFfZYwi6H5FZptPu5GzmQzY4YR2aLTFraqgYWzOywfrrDPr0 ax360urDQ91onEf36WuBFjO65H7PET/vRx4W1oqwkU1Iy+6e17Jz9ZTN8xQ4/Ge1 oj4EvtxxqwpULJXCPGyi1RfRiNx8opw4eIcVfklsk+UGAErvF5Rhlii4zEvzLYZ1 S/Bm4VKbQXoetuaKHc7BfzhPCUPQ5bDpM8Ifrlin3YU9811DI7PGgEwD9t76Re1a zPqe3VwxuJtTuVjv9xO4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeiuddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhepfffhvffufggjfhfkgggtgfesthhqmhdttderjeenucfhrhhomhepfdftohif rghnucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtg drtghordhukheqnecuggftrfgrthhtvghrnhepueevleffieefgefhhfeujeduteeigeet teegffegledvhffhleevvdeijedugeeunecuffhomhgrihhnpeefvheglhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhp rdhphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 12 Apr 2024 09:27:34 -0400 (EDT) Date: Fri, 12 Apr 2024 14:27:29 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC][Vote announcement] Property hooks User-Agent: K-9 Mail for Android In-Reply-To: <66160A1D.4060409@adviesenzo.nl> References: <66154AA0.1040905@adviesenzo.nl> <66160A1D.4060409@adviesenzo.nl> Message-ID: <237C3A81-2906-4108-A6E4-5BA4BE156D91@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 10 April 2024 04:40:13 BST, Juliette Reinders Folmer wrote: * Whether a type can be specified on the parameter on `set` depends on whe= ther the property is typed=2E You cannot declare `set(mixed $value)` for an= untyped property, even though it would effectively be compatible=2E This i= s inconsistent with the behaviour for, for instance method overloads, where= this is acceptable: https://3v4l=2Eorg/hbCor/rfc#vrfc=2Eproperty-hooks , t= hough it is consistent with the behaviour of property overloads, where this= is not acceptable: https://3v4l=2Eorg/seDWM (anyone up for an RFC to fix t= his inconsistency ?) Just picking up on this point, because it's a bit of a tangle: PHP current= ly makes a hard distinction between "typed properties" and "untyped propert= ies"=2E For instance, unset() works differently, and the "readonly" attribu= te can only be added to a typed property=2E That's actually rather relevant to your point, because if this RFC passes = we would probably need to consider that PHP has at least 4 types of propert= ies:=20 - dynamic properties (deprecated by default, but allowed with an attribute= ) - declared but untyped properties - typed properties - virtual properties But maybe 6, with:=20 - untyped properties with hooks - typed properties with hooks Of course, most of the time, users aren't aware of the current 3-way split= , and they won't need to think about all 6 of these variations=2E But there= are going to be cases where documentation or a future RFC has to cover edg= e cases of each=2E I do think there is scope for removing some features from the RFC which ar= e nice but not essential, and reducing these combinations=2E For instance, = if we limit the access to the underlying property, we might be able to trea= t "virtual properties" as just an optimisation: the engine doesn't allocate= a property it knows will never be accessed, and accesses to it, e=2Eg=2E v= ia reflection, just return "uninitialized"=2E I am however conscious that RFCs have failed in the past for being "not co= mplete enough" as well as for being "too complex"=2E Regards, Rowan Tommins [IMSoP]