[development] Easier PHP4 compatibility for Drupal modules

Jose A. Reyero drupal at reyero.net
Tue Jun 10 10:57:30 UTC 2008


It seems many of us -if not most of us- are already developing modules 
and other stuff using PHP5. As a module maintainer I'm bothered from 
time to time with "PHP4 compatibility" feature requests and patches that 
are usually like this one:

|if (!function_exists('array_diff_key')) {
  function array_diff_key() {

|So most of the times, its just a few conditional function definitions 
that will make the module backwards compatible with PHP4. I'm thinking 
it would be really nice to have a 'php4' Drupal module that handles 
these simple cases. Then we can just tell people wanting our modules to 
work with PHP4 to go and try this other module.

This module also wouldn't even need to use conditional function 
definitions as it is supossed to be enabled only for PHP4 sites so it 
would be even easier.

So.. Anyone?

PS: Yes, I know, "why don't you do it yourself?"  But a) I am already 
maintaining a number of modules and I can hardly keep up with the issue 
queue - I've already added some to the "Abandoned modules" user - and b) 
I'm not using PHP4 for anything anymore so I won't even be able to test 
such a module....

So please, someone who needs PHP4 compatibility.....

Jose A. Reyero

More information about the development mailing list