This is a discussion on Call to undefined function within the PHP General forums, part of the PHP Programming Forums category; I have just encountered a fatal error using file_put_contents() on a PHP4 box. After a bit of research I found ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have just encountered a fatal error using file_put_contents() on a PHP4 box.
After a bit of research I found a simple function within the php.net user comments. I just wanted to know what happens if I then tried to run this script on a PHP 5 box, whereby I'd be defining a function that already exists. Should I be changing the name of the function just in case it moves to PHP5 in the future? Thanks, Tom |
|
|||
|
On Tue, 14 Nov 2006 09:36:52 +0000, Tom Chubb wrote:
> I have just encountered a fatal error using file_put_contents() on a PHP4 box. > After a bit of research I found a simple function within the php.net > user comments. > I just wanted to know what happens if I then tried to run this script > on a PHP 5 box, whereby I'd be defining a function that already > exists. > Should I be changing the name of the function just in case it moves to > PHP5 in the future? > Thanks, Hi Tom, if (!function_exists('file_put_contents')) { function file_put_contents (...) { // Do it your way! } } Ivo |