Archive:

Leaving PHP4 behind...

It's been quite some time ago that I learned programming PHP in 2000. PHP4 had just been released [1], and I was happy when I finished my first lines of code, printing out a simple "hello" to the world.

Luckily there were many hosters who announced to provide PHP4 on their servers, so I could start to code my own little templating system that generated the header and the navigation menu for my website. Until then, one had to learn far more difficult languages (allow me to say that Perl is one of them) for reaching a similar goal.

At the same time, lots of PHP4 based applications like TYPO3 were coming up and waiting to be used on the Internet. Platform independence, an Open Source license, lots of extensions and bindings, and probably also the good documentation made PHP4 soon become the number one language for web based applications.

As I wrote above, that was 7 years ago. TYPO3 is still using PHP4, which certainly has been improved hugely over time, but did not adapt any new concepts that would make a programmers life easier. (By the way, we are encountering a similar situation with TYPO3 version 5 which will also introduce some radically new concepts and draw a line behind outdated features.)

Although PHP5 (the everything-is-better successor) has been released exactly three years ago (5.0.0 came out on July 13, 2004), we still have to stay compatible with the old-school PHP4 version. The major reason for this is that ~80% of all hosters have still not switched to PHP5 by default. As long as they won't provide PHP5 out of the box, we obviously cannot use the power of PHP5.

The GoPHP5 initiative

Since we [2] finally want to move on now, and since we are not alone with this situation, we have worked together with various PHP based projects to announce the GoPHP5 initiative [3].

Our goal is that all these projects, together, will no longer support PHP4 after February 5th, 2008. In fact, a minimum version requirement of at least PHP 5.2.0 has been defined.

What does that mean?

TYPO3 4.2 is going to be based on PHP 5.2

If you are using PHP 5.2 already, nothing will change for you

If you are using PHP 4.x you will be provided with patch-level updates for TYPO3 4.1 for one more year (more information about future release cycles will be announced soon)

If you are using PHP 5.1 then you might be in luck... We are aware that enterprise Linux distributions of Novell and RedHat do not ship with PHP 5.2 yet (they both come with 5.1). Therefore, we will avoid using PHP 5.2 any specific features in TYPO3 as long as they have not switched.

comments

comment #1

SteffenJuly 13, 200705:27

The holy cow.

The main problem is that mod-php4 conflicts with mod-php5 on most distributions. That means that you (the user) are confronted with mod_cgi etc. instead of ready-to-go webspace, if you are bound to apps that depend on a

PHP 5.2.0 is out since 02-Nov-2006.

comment #2

SteffenJuly 13, 200705:38

[sorry, being interrupted]
... If you are bound to apps that depend on a certain PHP version, you will be driven into situations to choose between PHP4 apps and PHP5 apps. Worst case.

Btw. PHP 5.2.0 is out since 02-Nov-2006, (eight month ago, not three years).

php5, at last! @Steffen, I don't see a problem as php4 code runs on php5.

comment #6

Michael StuckiJuly 13, 200710:44

Hi Steffen,
just to let you know: I'm soon going to publish an article about installing PHP4 and PHP5 in the same environment using FCGI. Afaik this is the most powerful way of running PHP anyway...
- michael

My host switched from PHP4 to PHP 5.2.3 a few days ago.
It looked as if my typo3 4.1-based website is not affected, but Today i realized, that it throws serious "Cannot re-assign $this" messages to me on the BE, upon trying to create and save a page, or try to modify a tt_news article or just want to clear the FE cache... so my CMS is dead, basically. Is it fixed in 4.1.2 or should i wait 6 months until 4.2 is released? :((
So much about the glory of PHP5 and Typo3...

OK, i quickly found the solution: this was not Typo3 nor PHP5 to blame, just a required/common Typo3 plugin called Static Info Tables.
Upgrading that to 2.0.5 solved the "Cannot re-assign $this" problem.

Actually it seems, that PHP5 become a bit more strict (demand more precise coding principle) thus more unforgiving to some coding errors.

Buzz is the official blog resource of the TYPO3 project. You can be part of Buzz too. If you want to blog about the achievements of your team or your personal involvement please check out our HELP section.