Call to undefined function

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-14-2006
Tom Chubb
 
Posts: n/a
Default Call to undefined function

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
Reply With Quote
  #2 (permalink)  
Old 11-14-2006
Ivo F.A.C. Fokkema
 
Posts: n/a
Default Re: Call to undefined function

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0