Jump to content

Edit pre-built in functions


EchoFool

Recommended Posts

Hey,

 

If i make a function named "function mysql_error()" Will php allow me ?

 

Because mysql_error is already set up as default will it not allow me to use it or will it use my function over the pre-default one ?

 

OR can i just find a way to edit mysql_error() as that would save me editing alot of scripts.

Link to comment
https://forums.phpfreaks.com/topic/196441-edit-pre-built-in-functions/
Share on other sites

I'm not exactly sure how functions will behave if you create one that already exists, but I can tell you that you can create functions in older PHP versions that are used by newer PHP functions to achieve the same result. In example, the realpath_cache_size() function was added in PHP 5 but you can create a function in PHP 4 with that name to create a function that does the same that it would do in PHP 5 - or does something completely different. Hope this helps.

Hey,

 

If i make a function named "function mysql_error()" Will php allow me ?

 

Because mysql_error is already set up as default will it not allow me to use it or will it use my function over the pre-default one ?

 

OR can i just find a way to edit mysql_error() as that would save me editing alot of scripts.

 

APC, or source, but it is highly discouraged. Why on earth would you do this. It's the antichrist of portability.

Because my alternative is to go through thousands of lines of codes and hundreads of scripts and replace mysql_error to my own custom function and that is going to take weeks.

 

I still fail to see a real scenario in which this would be needed.

Because my alternative is to go through thousands of lines of codes and hundreads of scripts and replace mysql_error to my own custom function and that is going to take weeks.

 

Have yo not heard of search and replace?

 

I was going to mention grep/sed, but I thought I'd get lashed.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.