Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123101 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 E58571A009C for ; Wed, 10 Apr 2024 19:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712777507; bh=YsHmtb6utjCJQ28oRr7eaXceGSar10QLfAqsnc/WTig=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dWQwjZRd71UFQMr5cWGLZfj37jDI3vlmbgLWBGmvQbukMX+38ydAVBhHsXBV072Ns W60jXE/DGFeIxJ5/IHNbj+cbfg83LjL/7OKaKA66bM/l8AKgbdznBsN3I/WzDPAeTh O6rfTdrhH8KVOq8X2Rt3qZ7QeKF1tFfehsvaOzXf80+8M0+C8Tt1GVhOAO1OV0+sm1 H/ilK0xt4S5MCly2TVYA14LfO1UY2s7rZD7U4BMrn1hNsbwORii+cZbRemL2ugL8dY /1xuKDFgtfDVXNkmCUi7X5OhIpexzbBWDGWnd9I8BhQFWA2VTzSr0aueXr9KPsKUPQ mJqBizjJSfq/A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DA6E5180069 for ; Wed, 10 Apr 2024 19:31:44 +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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 10 Apr 2024 19:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1712777469; bh=nvqEkd8Z5nSpf+72lpAHPexQVVgw081H+xE0MuorP0k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=Bu73XgNNnhtPRx2Uu2bS+wIkmf2/2iyC8R58blBF0xKOeTvlM+PUmNMDHPcMJuQFA Gtfl68Hn3dfhdVwsbw2MGHEpY5yUE5mK4BT3wNL8DcLtczqnHYQwrHoTbgPFECgIc8 G47JgrwEZLG8XahtBBosPpfs4TW+Ya3pCaYOAlYKs1bGNCT9Yn7ZpXO43BNCWgwjhM MBt8OH2DLNZ5KKfczooYIK2e518vg+l8EBnrpbrCX0bHw04JDltm/0GoTHV55BGj/3 GzLSCD+Q4k0bv8PtJuduU695opSE6vHwqRVPI4crpyjAUh1EepoYNrlCtGUKMFJ9qy ysXRwwqyqtByw== Message-ID: Date: Wed, 10 Apr 2024 21:31:08 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC][Vote announcement] Property hooks To: Arvids Godjuks , Juliette Reinders Folmer Cc: internals@lists.php.net References: <66154AA0.1040905@adviesenzo.nl> <66160A1D.4060409@adviesenzo.nl> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 4/10/24 10:28, Arvids Godjuks wrote: > The amount of complexity in these two hooks is on the level of the whole > PHP OOP model with the number of footguns and WTF cases to rival magic > quotes, register_globals=on and every other infamous gotcha we had in the > engine that got deleted out of existence. As someone who read the RFC like 20 times while it evolved (and just read it once more before submitting this email): Most of what the RFC spells out explicitly, because that's what RFCs need to, is a pretty much natural consequence of how the existing PHP features work. You cannot really shorten the RFC without either making it underspecified or useless. Is there some syntax that could technically be omitted? Sure. Would doing so meaningfully simplify the RFC? No, because most of the text length comes from the interaction of existing syntax and semantics with hooks and thus is an inherent property of property hooks (pun not intended). It's not the RFCs fault that references exist, or that casting an object to an array is legal, or whatever else needs to be explicitly spelled out. I also believe that the chosen syntax fits nicely with the existing syntax, borrowing syntax where useful and inventing new syntax where the existing syntax does not provide anything. It's a clear improvement over the status quo of __get() and __set(), especially from a third-party tooling perspective. I'm in favor. Best regards Tim Düsterhus