News for hackers. Stuff that matters.
Re:A Crash-Course in PHP Namespaces for WordPress Developers by toast0 on Monday May 07, 2018 @04:01PM (#17016005)
WordPress and other large, popular projects got where they were by meeting their users where the users already are.

If I have to convince my webhost to install PHP 7 or I can't run your software, I'm not going to run your software. If I have to convince my webhost to install PHP 7 or I can't upgrade your software, I'm going to run the shitty old version until it gets hacked into a distribution site and the bandwidth use gets high enough for me to notice and turn the whole site off.

I'm not familiar enough with PHP these days to know, but if upgrading to PHP 7 is going to break the shitty old version, that's a problem too. (I think PHP has tended to be pretty good about not breaking things on upgrades though)

Re:A Crash-Course in PHP Namespaces for WordPress Developers by smacktoward on Monday May 07, 2018 @05:03PM (#17016472)
> if upgrading to PHP 7 is going to break the shitty old version, that's a problem too

The problem is that PHP 7 finally removed some legacy APIs that had already been deprecated for an eternity. The removal wasn't a bad decision in and of itself, but there's a non-trivial amount of code in the wild that still uses those ancient APIs, either because it was written more than a decade ago before they were deprecated, or because it was written by people who either didn't understand what "deprecated" means or didn't care. So when that code moves from 5 to 7, it breaks.

WordPress core is developed by smart people who stay on top of changes in the language they work in, so moving to 7 wasn't a problem for WP itself. It was a problem for lots of WP themes and plugins, however, since there's lots of those that were written and then abandoned before 7 was a thing, and even some that were written by people who knew 7 was coming and just didn't understand why they should care.

If I were going to suggest one thing WordPress itself could do/have done to make the transition less rocky, it would be to require PHP 7 compatibility for plugins and themes distributed through the official repositories at wordpress.org. Currently that's not a requirement -- there's not even a way to filter out PHP 7 compatible plugins and themes from the ones that are stuck on 5. So unsophisticated users are still getting recommended software by those repositories that will break if you run it in a modern PHP environment.

(You can avoid this problem somewhat by looking for other heuristics that correlate well with PHP 7 compatibility -- actively updated plugins will tend to be compatible, well-reviewed plugins will tend to be compatible, etc. But you can't just ask directly for plugins that will work with PHP 7, which is a shame.)

Re:A Crash-Course in PHP Namespaces for WordPress Developers by onion2k on Monday May 07, 2018 @04:26PM (#17016198)
If I have to convince my webhost to install PHP 7...

It's a very long time since I used any sort of shared hosting, but do companies that use a single instance of PHP for multiple accounts still exist? I though they'd all moved to virtual servers with separate configs per account. Upgrading is a matter of changing a variable in cpanel somewhere.

Re:A Crash-Course in PHP Namespaces for WordPress Developers by munk-a on Monday May 07, 2018 @04:54PM (#17016404)
Technology moves forward and there isn't a suggestion that older versions of wordpress stop existing, just that a new version should be cut on PHP7 so that sanity can creep in.

There were some BC breaks in PHP7 but most of them will only hit you if you're a terrible person, the easiest to demonstrate is that

list($a[], $a[]) = [2, 3];

Went from $a being [3, 2] to [2, 3] in PHP7.

Re:A Crash-Course in PHP Namespaces for WordPress Developers by chiefalchemist on Monday May 07, 2018 @06:00PM (#17016835)
I see it differently...If nearly 30% of the internet is running Product X and Host Y doesn't think it's a good idea to enter the 20th century, then Host Y should not be rewarded.

For all intents and purposes WP is rewarding bad behavior to the detriment of the rest of the internet (read: anyone who visits a WP-based site).