On 10/04/2023 16:10, Thomas Bley wrote:
So having support for multiple php versions inside one binary would be a great 
thing, same as modern web browsers still support html 4 even though html 5 is 
out for so many years.


As far as I'm aware, browsers have no specific support for HTML 4. Arguably, they have no specific support for HTML 5, either. They (aim to) implement the "HTML Living Standard", which has a carefully designed parsing algorithm and three modes ("no-quirks", "quirks", and "limited-quirks"), which standardise and emulate certain behaviours of older browsers, not necessarily older specifications.

Certainly, web technologies like HTML + DOM, JS / ECMAScript, and CSS, are good examples of carefully maintaining compatibility where possible, and including features specifically to keep old websites working. But that doesn't mean no feature is ever removed, and no default behaviour ever changes. Nor will there be an ever-growing list of switches to go back to what things looked like 10, 20, 30 years ago.

That's because maintaining extra behaviour is difficult - adding the feature switch might be just a few lines of code, but it will *multiply* a section of tests; and it will need to be re-implemented to pass those tests every time the surrounding code is refactored, and accounted for every time a related feature is added.

That might be worthwhile for one or two switches - HTML's "quirks" & "limited-quirks", JS's "use strict" - but it doesn't scale, so it's never going to replace the genuinely hard question of how to improve a language for new code, while limiting pain for existing code.

Regards,

--
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to