12 ms·
Apparently some of the deprecations will make this the most backward compatibility breaking version jump of PHP since V4 to V5. (Read a german interview here: h
by cstuder 6y ago
Apparently some of the deprecations will make this the most backward compatibility breaking version jump of PHP since V4 to V5. (Read a german interview here: https://www.heise.de/news/PHP-8-im-Experten-Check-Der-erwartete-harte-Bruch-mit-der-Vergangenheit-4970530.html?wt_mc=rss.red.ho.ho.atom.beitrag.beitrag https://www.heise.de/news/PHP-8-im-Experten-Check-Der-erwart...)
There's a long report on Wordpress and PHP 8 and it's not pretty: https://developer.yoast.com/blog/the-2020-wordpress-and-php-8-compatibility-report/ https://developer.yoast.com/blog/the-2020-wordpress-and-php-...
- tyingq 6y ago"There's a long report on Wordpress and PHP 8 and it's not pretty" I wonder if that's somewhat on purpose. Part of the remaining stigma with PHP is that people cite bad PHP examples from WP.
- cstuder 6y agoNo, I think WordPress being the most installed PHP application on the net warrants the special attention to it. https://w3techs.com/technologies/overview/content_management https://w3techs.com/technologies/overview/content_management
- BeyondLimits99 6y agoAs a PHP dev this is a really fair comment. I think the other reason non PHP devs think we are in the dark ages is because when they google it, our documentation looks like it's from 2010. It's a bit of a joke really.
- samus 6y agoOne other thing I always found iffy is the comment section. Why is the information there not reviewed and back-ported into the documentation? Sometimes, as on the page of the `DateTime` class, they actually contain crucial details!
- muglug 6y ago> There's a long report on Wordpress and PHP 8 and it's not pretty This is an awkward side-effect of WordPress core team largely neglecting PHP code quality issues for the last decade or so. With good reason – improving such a large codebase is a massive, mostly-thankless task.
- Kluny 6y agoI worked at WordPress for half a year, and I'm no expert, but the code reviews there were more intense than any I've ever experienced. Every line of code gets reviewed before it gets committed, and if the commit is longer than 20 lines or so, it undergoes an additional scheduled review as well as pre-commit review. They also have pretty good code sniffers that ought to catch errors like OP mentioned. The reason they're concerned, I think, is because they try to protect users who have plugins that came from their plugin repository, where the same code quality rules don't apply. WordPress has always been huge on backward compatibility.
- muglug 6y ago> WordPress has always been huge on backward compatibility. Yes, and I think that's ultimately the root of its challenges. A fear of breaking things means WP shies away from large-scale changes that would help it become a modern-looking PHP app. I wrote this two years ago, and WordPress's basic architecture hasn't changed since: https://medium.com/@muglug/improving-wordpress-with-static-analysis-505cc5ba495d https://medium.com/@muglug/improving-wordpress-with-static-a...
- marc_io 6y ago> A fear of breaking things means WP shies away from large-scale changes that would help it become a modern-looking PHP app. They are strongly advocating Javascript as the future of WordPress right now, so I'm not sure if they would like it to become a modern looking PHP application.
- eitland 6y ago
- nolok 6y agoReading the list of things that worry them makes it clear that it's not so much php is breaking bc than it is wordpress lack of cleaning and linting for so long catching up to them. I mean seriously the first thing they list as a worry is that arithmetic operators will now throw an error when one (and only one) of their operand is an array or resource (eg array + array support remains, it's really int + array or string + file_descriptor, things like that). This is literally a case that makes no sense in the code ever, not one of the "php used to do something magical for us" but "php used to keep silent about this buffonery", so if your code does that you have bigger worries ... Almost every single one of those things are easy to fix, in that it requires mostly time not much if any redesign, and almost every single one of those things are also deprecated or on their way out since at least a decade.
- ComputerGuru 6y ago> This is literally a case that makes no sense in the code ever, Speaking as someone that hates PHP but still appreciates that it has its uses: You’re speaking from one perspective. There are others. That operation is perfectly valid and well-defined in Matlab where it increments all members of the matrix/vector by the scalar.
- oseityphelysiol 6y agoDid it php use to do that? Otherwise your point is invalid.
- deleted 6y ago[deleted]
- Denvercoder9 6y agoBut PHP didn't do that, it just silently ignored the operation or returned zero. That behaviour doesn't make any sense.
- ufmace 6y agoThis is actually a perfect example of why I don't like these magical overloads for what looks like basic mathematical operations. It's perfectly obvious to everyone what adding 2 numbers does. It works the same in basically any computer language. What happens when you add a number to an array though? There is no universal obvious rule, it depends on whatever was convenient for whoever initially wrote that overload. You just have to remember what it does in this language. Maybe it appends it to the array, maybe it does the operation on the first or last entry of the array, maybe it does it to everything in the array, or does something else entirely. Does it modify the array in place, or create another copy with the change? Woe betide anyone who forgets what it does there or gets it mixed up with another language. Better IMO to at least have functions with clear names for doing these sorts of things.
- oseityphelysiol 6y agoI never want to get within a mile of a wordpress website after reading this.
- pbowyer 6y agoWordPress core team members and users are welcome to get involved in PHP development and providing feedback on proposals. They are notably absent, and so people who write modern PHP - or wish PHP was a different language - are the ones influencing language development.
- chipotle_coyote 6y ago> And so people who ... wish PHP was a different language are the ones influencing language development. That's definitely been my impression. I used to be a professional PHP developer, still use it occasionally for personal projects, and appreciate the language, warts and all, even if I can't truly say I love* it -- but I'm only half-joking when I quip that PHP has evolved from its roots as a cargo cult version of Perl into a cargo cult version of Java.
- adimitrov 6y ago> - but I'm only half-joking when I quip that PHP has evolved from its roots as a cargo cult version of Perl into a cargo cult version of Java. It's a joke in so far as it is funny - but it's absolutely correct. When you only look at the language... When looking at the VM, Java has an absolutely world class VM, with great engineering and decades worth of research poured into it. PHP has... no such thing.
- cutler 6y agoA world class VM tied to a dinosaur language in which you still have to escape regex metacharacters.
- The_rationalist 6y agoWhat are you talking about? Java has raw strings (autoescaping) https://openjdk.java.net/jeps/378 https://openjdk.java.net/jeps/378 Moreover Kotlin allows to have a state of the art language in a state of the art vm
- 6y ago
- casperb 6y agoWow, that Wordpress blog is bad. I have seen a lot of projects add support for PHP 8 in recent weeks and they were all kind of easy. Mostly waiting for upstream packages to be ready. You get nice warnings for years about stuff to fix. If you ignore them because that is easier, there comes a point where it is so bad that you cannot recover. I know the Wordpress codebase is nasty. But how and when are they going to fix these things? It is going to be so hard.
- bufferoverflow 6y agoJust tried it on a Laravel project I'm working on, on Windows. Worked flawlessly. On the downside, no noticeable performance improvements. Report generation times: PHP 7.4 = 67ms avg PHP 8.0 = 66ms avg This is getting the data from MySQL and massaging it for the templates. With Laravel's insane amount of indirection, of course.
- krick 6y agoWhy would you expect performace improvements? Because of JIT? There's no reason to hope that JIT would help with that much, because it's I/O-bound anyways. And function calls in PHP are pretty efficient.
- bufferoverflow 6y agoPHP 8 performance improvements were advertised https://www.fonow.com/Images/2020/0608/9f3a0f6a4f8f2ee.png https://www.fonow.com/Images/2020/0608/9f3a0f6a4f8f2ee.png https://www.fonow.com/Images/2020/0608/4e9d2337edd2072.png https://www.fonow.com/Images/2020/0608/4e9d2337edd2072.png https://www.fonow.com/Images/2020/0608/70a1c6cff23f4fc.png https://www.fonow.com/Images/2020/0608/70a1c6cff23f4fc.png
- krick 6y agoOh, come on. Did you see the benchmarks? This is CPU-bound code, like multiplying numbers 100 000 times over. This has nothing to do with your typical use case. And, yeah, performance improvements are always advertised.
- rovr138 6y ago>This is CPU-bound code, like multiplying numbers 100 000 times over. This has nothing to do with your typical use case. I think a lot of people missed this. It's not the usual PHP workload for usual/basic web dev.
- smsm42 6y agoWordpress is a bit special case though as it has tons of very old code and a lot of plugins, some of which aren't maintained anymore.
- no_wizard 6y agoReading this list reminds that nobody cares about the tech/engineering decisions of a product if it solves their use case. That is shockingly poor practice and state of a code base for a product that powers so much of the web
- tempguy 6y agoI would like to hire you for a nsd + unbound high performance setup are you available? it seems the email in your profile doesn't work anymore. do you have telegram or something?