Re: include() and duplicate function definition

From: Date: Wed, 03 Nov 2010 10:44:16 +0000
Subject: Re: include() and duplicate function definition
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-309265@lists.php.net to get a copy of this message
You can check with function_exists to see if a function is already defined. If not, create it. Regards Peter On Nov 3, 2010 11:40 AM, "David Nelson" <commerce@traduction.biz> wrote: > Hi Thijs, :-) > > On Wed, Nov 3, 2010 at 18:18, Thijs Lensselink <dev@lenss.nl> wrote: >> As far as I know it is not possible to overwrite functions in PHP (unless >> you use runkit, apd). Inside classes this is possible. But that's not the >> case here. Why do the functions have to be equally named? > > If the functions aren't named the same, my replacement function will > never get called by the code that uses the WordPress theme code... > >> Try to create a new function and call the original function from there if >> needed... > > Sadly, it wouldn't work for the above reason... > > But thanks for your answer. :-) > > David Nelson > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#309265) next »