Declaring tidyNode properties as readonly?

From: Date: Mon, 09 May 2022 07:17:49 +0000
Subject: Declaring tidyNode properties as readonly?
Groups: php.internals 
Request: Send a blank email to internals+get-117700@lists.php.net to get a copy of this message
Hi Internals, When I was working on making the properties of the tidy and tidyNode classes declared (https://github.com/php/php-src/pull/8515), I noticed that it doesn't make sense to write the properties of tidyNode, as the property changes won't have any effect on the parsed HTML node. Christoph provided an example to highlight the issue with this behavior: https://github.com/php/php-src/pull/8515#issuecomment-1120400605. In my opinion, the properties in question should be declared as readonly in order to make the behavior of tidyNode more predictable. Of course, this would be a BC break, but I believe the use-case is so niche and misleading that we can afford to prevent it right away in PHP 8.2. Please let me know what you think about this change, especially if you are aware of any valid use-cases regarding the modification of the properties of tidyNode. Regards, Máté

« previous php.internals (#117700) next »