Drupal and PHP 5 again

Nick Lewis has set off a bit of a firestorm with his latest blog, "Drupal is Part of the Problem". In short, his argument is the same chicken-and-egg that the PHP dev team keeps saying: Hosts won't move to PHP 5 until the applications are there, so the big applications need to lead. In a sense he's right; web hosts are by necessity cautious and conservative. At the same time, though, developers can't take the whole blame.

Nick's suggestion was to set a future EOL for PHP 4, around Drupal 7 or 8, as a warning shot. Personally I'd be fine with that. I'd love to switch to PHP 5. Palantir.net now only supports PHP 5 servers, but we can afford to be choosey because we get to pick the host. Dries followed up as well, proposing that Drupal start making non-critical functions start requiring PHP 5. I like that idea, too. :-) That was part of the logic behind my efforts to get a PDO driver into Drupal. (That's temporarily on hold while I try to figure out why there doesn't seem to be much speed difference, but I do intend to come back to it.) Honestly I don't see why we can't do both. Count me in as +1 to a PHP 5-only Drupal 7 and a PHP 5-benefitted Drupal 6.

Dries brought up an important point, though, one with Steven Wittens brought up as well. The PHP Dev team itself has to share some of the "blame" for PHP 5's terrible adoption rate. Even many PHP devs say that PHP 5.2, released only last fall, was the first really solid version. Web hosts don't have a compelling reason to upgrade the way they did from PHP 3 to PHP 4. PHP's API is still very 90s, with lots of conflicting name functions. They're really nice functions in many cases, but the overall vision of the API is very inconsistent. As to modern features like closures, first-class functions, array/object literals, and other Javascript-like language functionality, please! Just closures alone would make me a very happy man.

There's another problem, though, that is less often mentioned. PHP 4 is still supported by the PHP development team. Why should a web host upgrade to PHP 5 when they still get bugfixes and security updates for PHP 4? We asked that question of Rasmus at DrupalCon, and his response was that they couldn't stop providing support for PHP 4 while it still commanded 80% of the PHP install base. Isn't it rather hypocritical to say that Drupal/Joomla/WordPress developers should cut off 80% of PHP installations when the PHP dev team itself won't do so? Does Microsoft still support Windows ME? (Hint: No they don't.)

Ken Rickard had an interesting idea regarding Drupal and Joomla, the two biggest PHP open source CMSes, coordinating to drop PHP 4 support around the same time. That sounds like a great idea to me. If the WordPress guys were on board as well, there's the 3 most high-profile modern PHP systems all drawing a line in the sand together. If the PHP dev team won't EOL PHP 4, the community may be able to, but only if they do so together. Perhaps that's something the Drupal Association could look into? I know it's explicitly forbidden from directing development, but this would fall more under the coordinating with other projects heading, for which the Association is really the only formal entity that could do so, except Dries personally.

And of course there's been the predictable "use Python" post. Really, that's unrealistic and grows more-so every day. So much of Drupal is built on features and designs that are PHP-specific. Almost everything is becoming a nested array structure. Those are extremly fast and powerful in PHP, especially given the large set of array handling tools available (even more of them in PHP 5). Can Python or Ruby match PHP's array handling? I really don't know. But the language dictates so much about the framework that a direct port to Python or Ruby or godforbid Java would be practically impossible anyway.

Comments

Gallery team as well

Don't forget the Gallery team as well, they've been involved in this debate and they are quite big. Getting them onboard this would be great.

Them too

Indeed, yes. Gallery's another app that is very popular on shared hosts.

The question is, if we really did want to have a proper PHP 5 street demonstration, where would we bring that up around Drupaldom if we wanted to get the ball rolling? I'm not a member of the Association. General developers list? It doesn't really sound like an infrastructure@ item.

The other question is, would anyone around Drupal actually support such a move? :-)