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é
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.
I noticed that there weren't any responses to this, and since it
involves a potential BC break in 8.2, I wanted to follow up and make
sure others on the list have had a chance to review this and offer any
feedback, concerns, support, or opposition to this.
Especially regarding this:
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.
Cheers,
Ben