5 ms·
So essentially, PHP 9.0 is a different language, and not compatible with the vast majority of PHP applications out in the wild. This isn't necessarily a bad th
by bovermyer 5y ago
So essentially, PHP 9.0 is a different language, and not compatible with the vast majority of PHP applications out in the wild.
This isn't necessarily a bad thing, but it does mean that a lot of applications are going to be stuck on old versions.
For my part... I think this will make me fully abandon PHP and just rewrite old apps in other languages, like Go and Rust.
- zozbot234 5y agoIs there an easy way of doing HTML templating with Go/Rust, as you would in PHP?
- bovermyer 5y agoNot as easily as in PHP, but yes. https://pkg.go.dev/html/template https://pkg.go.dev/html/template (for Go)
- radlad 5y agoIMO the template package in Go is kind of awful. The contextual escaping is very cool (although a little frightening given the complexity of it), but the ergonomics of parsing, nesting, and executing templates is very confusing IMO.
- 0des 5y ago> the ergonomics of parsing, nesting, and executing templates is very confusing IMO Can you elaborate on this?
- smt88 5y agoRust has lots of template libraries. HTML templating is a solved problem that PHP doesn't uniquely do well anymore.
- steve_adams_86 5y agoI guess that depends on what you mean by “as you would in PHP”. I assume everyone uses something like Twig these days, so in that case, absolutely. You even get compile time checking from Rust libraries like askama: https://github.com/djc/askama https://github.com/djc/askama
- deleted 5y ago[deleted]
- tored 5y agoThere is nothing in this blog post nor in the PHP 8.2 release that suggests that PHP 9.0 will be different language and not compatible with previous versions.
- smt88 5y agoMajor backward-incompatibility is a huge mistake. Python made it and had 10+ years of a mess with incompatible v2 and v3 code bases confusing and infuriating people.
- yccs27 5y agoNow that you put it this way - is this going to be another python 2-to-3 problem? I hope they have some solution to quickly bring everything to the new version; the proposed changes seem reasonable though.
- alberth 5y ago>> "So essentially, PHP 9.0 is a different language How did you come to that conclusion from that post?
- bovermyer 5y agoPerhaps I should have qualified the phrase "different language." It'd be more accurate to say 9.0 is a dialect, rather than a wholly separate language.
- tored 5y agoYou can of course argue that any major update that breaks backwards combability the slightest is a dialect of the previous version, but that is just silly. - Looking for PHP 8.2 dialect programmers! - I have only coded in PHP 8.1 dialect. - Sorry, won't do. The changelog tells you want you need to fix on existing code when upgrading and the manual usually gives you a workaround if it is something larger. And in this specific case you just add the attribute #[AllowDynamicProperties] to you dynamic class and be done with it.
- deleted 5y ago[deleted]
- TheRealPomax 5y agoYep, thankfully PHP respects semantic versioning. Much like Python 3 broke 2.x compat, PHP 9 breaks 8.x compat. Although the truly backward compat breaking changes are quite few, and uplifting 8 to 9 will be fairly low effort (and almost certainly something that linting can spot for the vast majority of code bases with near-trivial fixes). We had to do this when we went from v4 to v5, we had to do this when we went from v5 to v7, we had to do this (but less so) going from v7 to v8, so if having to do this from v8 to v9 as well is suddenly too much work, either you haven't been using PHP for very long, or you took a weird moment to suddenly take exception with codebase migrations. Especially as, of all the version updates so far, 9 promises to be by far the most worth it.
- oversocialized 5y ago