Is it possible to replace a function in php (such as mail) and make it do something else?
function, php
Solution
There is an extension that allows you to override functions. It is meant to be used for debugging, but I guess you can use it for your needs. Take a look:
http://www.php.net/manual/en/function.override-function.php
If you wish to call the original function within your version, make sure you read this comment: http://no.php.net/manual/en/function.override-function.php#50821
Problem
I want to rewrite a function in PHP (let's say the mail() function), and want to make it so when I call mail() from now on, it will load my version of mail() and not the default php version. Is this possible in php? The reason I want to do this is because I have thousands of lines of code which call mail() and I don't want to rewrite all of them. Also for future reference, in computer programming, what is it called when you do something like this?