Drop PHP4 support or not?
Monday, 5. February 2007, 23:30:41
The other day while coding the installer of the InWeb CMS and finally fixed a problem with the x64Template engine's plugins system, I wrote the next test script:
<?php
require_once("include/x64Template.php");
require_once("include/x64T_plugins/array_as_tag.php");
$tpl = new x64Template();
$tpl->set("T_VAR","test value");
$aat=&$tpl->add_plugin("array_as_tag_plugin",array());
$lang=array();
$lang['name']="spanish";
$lang['bye']="adiós";
$lang['hello']="Hola";
$aat->set("L",$lang);
$content="Hello, this is a {tag:T_VAR}! In {tag:L.name} you say hello as {tag:L.hello} and bye as {tag:L.bye} ;)";
echo $tpl->parse($content);
echo "\n unplugging plugin:\n";
$tpl->unplug($aat);
echo $tpl->parse($content);
echo "\n done\n";
?>
This script is suposed to use the new plugins system to load the Array As Tag plugin, echo some parsed test and then unplug the plugin and confirm it was unplugged by echoing the same text. Result when using PHP5:
$ php5 test.php
Hello, this is a test value! In spanish you say hello as Hola and bye as adiós
unplugging plugin:
Hello, this is a test value! In {tag:L.name} you say hello as {tag:L.hello} and bye as {tag:L.bye}
done
and php4:
php4 test.php
Hello, this is a test value! In {tag:L.name} you say hello as {tag:L.hello} and bye as {tag:L.bye}
unplugging plugin:
Hello, this is a test value! In {tag:L.name} you say hello as {tag:L.hello} and bye as {tag:L.bye}
done
Sadly but true: there seems to be a problem with PHP4's OOP support.
Even when I've tried and tried to find a workaround for this problem I haven't been able to find one.
At the moment I had to copy the current x64Template's code and adapt it to work with PHP4 (by disabling the new plugins system and making the array as tag plugin built-in) and the same for some parts of the InWeb CMS.
All this stuff is taking me a lot of time, so, I would like to hear what people think about only supporting PHP5. This decision mainly affects the next products/projects and any future project: x64Template, InWeb CMS









Loki1zI # 6. February 2007, 02:14
php 5 is really better for OO model and for realisation of MVC framework ideas. so i don't port my projects to php 4.
atomo64 # 7. February 2007, 00:21
Contrid # 9. February 2007, 02:55
Even so...I must admit that PHP5 has some amazing new, useful features.
Problem is...I mostly code applications for clients and very few of them actually have PHP 5 installed on their servers.
Let's give it some more time. PHP5 is around the corner.
atomo64 # 11. February 2007, 23:47
That's why I wonder how many users I would be loosing if I drop PHP4 support
PHP5 is almost three years old and PHP6 is a year or two away from now.
Stein # 28. March 2007, 21:07
At least wait until Debian Etch is released (very soon now) - it includes php5 so it may be worth waiting for people to upgrade their deb servers.
Just my 2 cent
atomo64 # 23. April 2007, 18:42