3 ms·
Why couldn't they just do what the article suggests: Quirks mode. That's how Internet Explorer managed to move forward. The entire web was written for IE 6, an
by Someone1234 12y ago
Why couldn't they just do what the article suggests: Quirks mode.
That's how Internet Explorer managed to move forward. The entire web was written for IE 6, and it seemed like progression would be impossible, so they just had everything render in an IE 6 compatible rendering engine unless the site told them it could handle something better (via DOCTYPE).
PHP could do the same thing. Everything renders in the current PHP rendering engine unless the *.PHP expressly tells the renderer "I'm modern!" and at that point the new renderer is utilised.
You could even have mixed old/new sites so that old libraries can be accessed via a modern PHP page. It might require some serious architecture work behinds the scenes but to get a brand spanking new PHP environment with backwards compatibility (when needed) would be a worthy goal.
- ZeroGravitas 12y agoThis is what I'd prefer, similar to "use strict" like Perl and Javascript.
- pilsetnieks 12y agoQuirks mode would create a lot more work for the maintainers that could be better used for advancing the language. If you really have an old codebase that cannot be altered for some reason, you could keep using an old version of PHP. I'd rather they kept 5.4 around forever as a long term support version than doubled the complexity of developing PHP as a language. The breaking changes and deprecations with each new version are relatively minor, if those cannot be made to your existing codebase, you also likely wouldn't develop anything new there and wouldn't need a quirks/strict mode. If you really need to, you can run multiple different versions of PHP at the same time.
- cygx 12y agoSee also Perl's use v5.XX / use feature, Python's from __future__ and Javascrip's 'use strict'.