Introduced under a smaller flag of taking care for testing, a new direction slipped into wordpress developement: To drop PHP 4 and switch over to PHP 5.2 as a minimum requirement for wordpress. Opinion leader Andrew Nacin made the igniting announcement. (Finally; some might think.)
PHP 4 in wordpress has a long history on it’s own. Three years ago Matt Mullenweg misunderstood the address of the goPHP 5 initiative and labeled version 5 of the free software project named PHP a failing product. Finally this chapter is to come to an end in the wordpress development timeline. This is about to happen in Q1 2011, and highly likely that PHP 5.2 (released November 2006) will be the version requirement for upcomming wordpress 3.1 – currently developed as the so called trunk (the main line of development).
The announcement came quite surprisingly because wordpress software development is currently known to be on hold for decisions of such type until the beginning of September. Developers are called to focus on improvements on the projects website instead.
The requirements of wordpress, specifically the compatibility with outdated PHP 4 versions, has been more and more questioned over a longer time-span by an ever growing part of the active developers in the community. Writing compatible code for the longtime outdated PHP version 4 (EOL: 2007-12-31) is nothing easy to do today. As a developer you need decent knowledge of PHP internals and how they changed between version 4 and 5. That version change dating back to July 2004 marked the upgrade of the default PHP interpreter, the Zend Engine, from generation I to II and with that, it introduced a new object model and changes in variable handling to name two prominent changes.
The PHP 5 demanding part of the wordpress user-base has started to jubilee over the long awaited decision and reacted quite actively and positive to the announcements.
Because the version change has been introduced for testing issues (to not need to do tests on older PHP platforms in the future), there is no need to even touch the codebase for the version change because the current code already runs on PHP 5.2 and up. Announcing developer Andrew Nacin on this:
For us, it’s about testing coverage. If we have finally reached the point where too few users are running and testing WordPress on PHP 4 and early versions of PHP 5 for us to be able to make an informed guarantee of their compatibility, then it’s time to move on.
But the change in requirements can lead as well to questions which benefit users of the open source software will have from the version change. Even there are many new features introduced in PHP 5.2 compared to PHP 4.3 (current requirement), the announcement might be too young, that there could be made much of a mind, which consequences this announcement will have for wordpress developers. If you read what Andrew Nacin write carefully, you might come to the conclusion: certainly not much as of now:
But it [the drop of PHP 4] is not about features, or language constructs, or needing to occasionally cater to PHP 4 syntaxes […]. […] Dropping PHP 4 won’t change us overnight, nor would it change our development philosophy.
As this is true for every grave development decision in the wordpress project, its true for this one as well. But maybe this change and the surrounding discussions will create a more open atmosphere for PHP related development topics and which features of PHP 5.2 to actively use to modernize the 5 years plus old wordpress codebase – without falling into overdrive for the PHP 5 demanding part of the developer base. Before introducing new designed code or even implementing development patterns, stones are lying around that need to be moved away first. The time these tidy-up actions would need is there until Q1 2011 – enough time for the job. Let’s do not rush things, 24 month I assumed in May 2009, so it’s all quite on schedule😉.
The WordPress codebase is known to follow the Big Ball of Mud-(anti-)design-pattern and most of the code has been written for the Zend Engine I / PHP 4.
Read On: WordPress 3.0 and PHP 4 – What’s the deal? (hakre; 10 May 2010)
- PHP 4 and MySQL 4 End of Life Announcement for WordPress (wordpress.org; 23 Jul 2010)
- Andrew Nacin’s announcement to drop PHP 4 (9 Jul 2010)
- Recent WordPress Developer discussion about PHP 4 / 5 (on wpdevel; 9 Jul 2010)
- Matt Mullenweg On PHP (13 Jul 2007)
- Switching to PHP5 (wordpress codex; 31 Jul 2009)
- PHP 5.0.0 Released! (php.net; 13 Jul 2004)
- PHP 5.2.0 Released (php.net; 27 Nov 2006)
- wordpress PHP5-List (hakre; 25 Dec 2009)
PHP 5 Related WordPress Tickets
Some of the following tickets are related to a change of a PHP version, some are to reference issues, that can considered to be solved after the version change to PHP 5.2 with no guarantee of completeness, see my PHP 5 List as well.
- Ticket #9751: Add notice for users running PHP 4 (7 May 2009)
- Ticket #10264: use instanceof instead of is_a() (26 Jun 2009)
- Ticket #3528: HTTP 304 status not sent correctly on PHP 5.2, breaking conditional GET on feeds (5 Jan 2007)
- Ticket #3354: PHP 5.2 & Fatal error in cache.php (12 Nov 2006)
- Ticket #1614: Only variables can be passed by reference in classes.php (23 Aug 2005)
- …and many more