Re: Re: function over loading?
| From: | Miguel Cruz | Date: | Mon, 13 May 2002 03:04:51 +0000 |
| Subject: | Re: Re: function over loading? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97293@lists.php.net to get a copy of this message | ||
On Sun, 12 May 2002, Smileyq wrote:
> KVose@alidaconnection.com (Kris Vose) wrote:
>> Can you practice function over-loading in php?
>
> No you cannot overload in PHP.
In a particularly masochistic project, we achieved function overloading by
creating a global array $F that linked public to hidden names of all our
functions. To overload, just change the hidden name.
$F['list_items'] = 'main_list_items';
Then later, if we wanted to overload list_items, just do
$F['list_items'] = 'substitute_list_items';
This functions would be called like:
$F['list_items']($param1, $param2, $etc);
It worked fine but sure took some getting used to.
miguel