# Replace a builtin function

- Thread: https://externals.io/message/45455
- Original archive: https://news-web.php.net/php.internals/45455
- Started by Aron Szabo on 2009-09-03T09:12:42+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45455 — Aron Szabo — 2009-09-03T09:12:42+00:00

URL: https://externals.io/message/45455#45455

Hello!

Is it possible to replace an existing PHP function ( like `mail()` ) in an 
extension.
I've been patching PHP to have a custom `mail()` function, but I think 
replacing
the mail function with an extension would be better and will save a lot 
of time.

Can somebody give me a clue or an extension that replaces a built-in 
function so I can study it ?

Thanks!

Sorry if this is not the right place for my question ...

Yours,
Aron

---

## #45456 — johannes@schlueters.de — 2009-09-03T09:25:08+00:00

URL: https://externals.io/message/45455#45456 · In reply to: #45455

Hi,


> Hello!
> 
> Is it possible to replace an existing PHP function ( like `mail()` ) in an 
> extension.

Look for the implementation of disable_functions.
(zend_disable_function() in zend_API.c)

johannes

---

## #45457 — Derick Rethans — 2009-09-03T09:30:06+00:00

URL: https://externals.io/message/45455#45457 · In reply to: #45455

> Hello!
> 
> Is it possible to replace an existing PHP function ( like `mail()` ) in an
> extension.
> I've been patching PHP to have a custom `mail()` function, but I think replacing
> the mail function with an extension would be better and will save a lot of
> time.
> 
> Can somebody give me a clue or an extension that replaces a built-in function
> so I can study it ?

Search for "set_time_limit" or "var_dump" at 
http://cvs.xdebug.org/cgi-bin/viewvc.cgi/xdebug/xdebug.c?revision=1.455&view=markup

regards,
Derick

-- 
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
twitter: @derickr

---

## #45458 — Aron Szabo — 2009-09-03T09:33:28+00:00

URL: https://externals.io/message/45455#45458 · In reply to: #45457

Thanks Johannes & Derick ! I see the light now :D

Yours,
Aron

Derick Rethans wrote:
> 
>
>   
> > […]
>
> Search for "set_time_limit" or "var_dump" at 
> http://cvs.xdebug.org/cgi-bin/viewvc.cgi/xdebug/xdebug.c?revision=1.455&view=markup
>
> regards,
> Derick
