Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116337 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78887 invoked from network); 12 Nov 2021 23:19:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Nov 2021 23:19:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D3381804BD for ; Fri, 12 Nov 2021 16:13:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 12 Nov 2021 16:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1636762422; bh=Q4IFriarlpfr6oHRLDufm2YABt7A+QTxnyTKdpjhBxY=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=aSh4XGdMT1L6k5M8zw6/9tmVw9LyIDQ1WBv/NjtxcCr3vlTQweM6JRpZygyBJ7GnD 7aWGDOZWjrSIzi5xJ2UaIA1WDZrGxh7PUzxyW+yXMHG0wwArHQeTI6Ez5w3IsnE8ev dkR7x+NgWFcbZhw00TKsT/Rzo12/BaES2sikgYHY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([79.222.37.121]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N8GMq-1mhXug1WlM-0148xg; Sat, 13 Nov 2021 01:13:42 +0100 Message-ID: <6e2d3e92-b53a-8264-85c6-d2d0062ee449@gmx.de> Date: Sat, 13 Nov 2021 01:13:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: de-DE To: Matthew Weier O'Phinney , Larry Garfield Cc: php internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:rLiGEVyf5zkvsv80qzoqo9kGczEeL7QvtAew0NpTgAvAoayylcl 1cGP82LQYHciDJ9bJlKkMAaxPod5hcT5S1joFdX2KxvcBEq1m3P3aIRgKiTo0OHUqPt+eW7 2bxRMP4pDQNfQgs7Ij5PI4/4KgF07Kw3ENZllyQD3jk8QMYsNhTZBGnxpKCSbrDKVRCI5zh tyBZNlcy51zrBzd+gIhfw== X-UI-Out-Filterresults: notjunk:1;V03:K0:F8oA6PFgPq0=:BUP1FmbAXeStbt0BIwGaur vNRWDQXhvfUpDzXv0Xbf5VxLfss+SJbMq/5+TaO02uv+Ca0bFs9Az5GFZARqeeWJ1nV9TmDtd VfjPXawwJ4cOmgsxTFrTLaNglsVQIqt6pJEWjD7rzLz5lrOCD6vkZNMpPpBvoYMCZaJZKPQCG d2xVAEB72uf3JeM7TAukDUDXplSTerlxgiF99u0+rIYrw6mX2fieIIKIm8cDKcCKD2QX+YD5d mfUzRAGHorwUQfN5yU0YsM5lCncBVUSGMH6Q/lTTuMCIdiXWZK3Q4UlN7WepvCWTTYo1Bf0cu xzmB8Iei9hfQgT0rdu2B9wKv/iQyj+0OYXx5TKcOAWOIY9JfwS5idVpstzpTVbaahUtGxr+xj 1zkOYgQLo4Sqc4TB0aq89JkikAZMzKunsBYl1Nv0emVf7yVV/pztODlNkCrBAoS1opTYeC/72 XDWgIBsinwJ+7y+3+RorPRjeiwLqsJbzosn6baMOMwPerQBP2ooah0Af1XrTGlyS2a3kHlZdU KrGvzAF0I9xOTJ9LIR6cXhVJ/rFmPeBZrRLPAh+IYlZgYDuiIcFfOam02wynKu2XE1VYGJyOF M6Ow2C0L/NeEpp1TsRzhqu+FQqn+4wwHT2A27HvnkL0d8r8aFYfTLo5xreuFeDCudApaKFchM Sh7GChtMOV73P6GgkEIX7TsVgG8Aoi5PU9zsN5B+ZNBIt/l2G+fXnOHuBklUp78opOWyJI+KN QgPDe2h7p6S+WuhLKoiCHvCLf97lGU1X+oZF0POYwbxulvk+YNjxu8I4f1uZkk15mEqrW0BVw P/fLGFwAgWjFAXC3o4h2XSOJE0HgD5At1ZZp81WrdbZwzAevKvymyDZnfvE7j2kIl8IVeKnYW NxuYO3YpS7W+ABbuMDB0XTnIV80x3b0RVKlJgRR//uyAXFRzbRjA59hI5OO/vK87aOQa/hE4q bHFxVKB1HdD5oIxoqn257JNublNPAyXoMAkAbIMhdV5tRHFL15v3at4LI14i//SVNCD18xI9H OcL4xyUnxvr6IUT+++G9IAF9Haa4V9T5iIjECd5HETbugP0nkkPSHcZzBcur2RAwWzNSvOiYW onKyeK8smWDVn4= Subject: Re: [PHP-DEV] [VOTE] Deprecate dynamic properties From: cmbecker69@gmx.de ("Christoph M. Becker") On 12.11.2021 at 23:34, Matthew Weier O'Phinney wrote: > On Fri, Nov 12, 2021, 3:41 PM Larry Garfield wr= ote: > >> The original version of the RFC would have (as of v9) allowed for the >> removal of some fugly code in property handling, resulting in engine >> improvements and some minor performance benefits. That was because it >> pushed the opt-in mechanism to "only if you extend stdclass", and stdcl= ass >> would effectively have a trait with stock __get/__set implementations t= o >> handle dynamic property behavior. (It wasn't quite that, but effective= ly >> that's what it would do.) So that was the original impetus. > > None of that information was in the RFC. That sort of thing really needs= to > be included, as it helps a ton in justifying changes of this nature. As = I > noted, on reading it, the only rationale made is a quick mention that th= ey > lead to programming errors, and even then, there's no detail really if > _how_. At some point, the RFC explained some of the internal implications: . To give one example: ; no that's not a memory leak, but rather the effects of materializing the properties HashTable. However, since the attribute solution, which already was a compromise to mitigate the BC break wouldn't make it possible to drop zend_object.properties and friends, this reasoning was removed. I still hope that we can get rid of this ugly stuff eventually. Obviously, that requires to educate people and to push code bases "softly". Offering an opt-out of dynamic properties or some switch to disable the deprecation would not help in that regard. That "leading to programming errors" is about userland code. Mistyping the property name might not even be noticed during development/QA, but may cause serious issues in production. Of course, a static analyzer would report this issue, but there is code where you'd have a hard time to get PHPStan level 0 or Psalm level 8 working (and baseline wouldn't catch existing issues). Oh, and well, we're actually talking about code which is not statically analyzed (or only at a very low level) anyway, don't we? > I'd like for a discussion on how we can allow the language to develop > without requiring yearly churn and burden on the surrounding ecosystem. = And > just waving your hands and saying deprecations aren't errors is not an > answer - if it makes its way to an error log or is reported inline in a > page or in CLI output, it's an error. I'd argue that it is not. There are different levels of errors, and you should likely treat them as such. An error or exception is more severe than a warning, a warning is more severe than a notice, and a deprecation is yet different again. You can ignore the latter, if you don't care about the next PHP major yet; you can actually exclude them from any kind of error reporting, until you care enough about them to resolve them. Even libraries could add a "suspended" ("won't fix *now*") label to respective bug reports (and re-open when the time has come). Anyhow, I'm fully aware that PHP is pushing for years now. As far as I know, COBOL did not. =2D- Christoph M. Becker