Is it possible to replace a function in php (such as mail) and make it do something else?

前端 未结 4 988
失恋的感觉
失恋的感觉 2020-11-28 11:45

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 de

4条回答
  •  攒了一身酷
    2020-11-28 12:34

    It's called function overloading and is not possible in native PHP but possible using the extensions outlined in the other answers. The PHP documentation claims it is not possible at all: source which is incorrect.

提交回复
热议问题