Re: Redeclaring functions
| From: | Martin Wickman | Date: | Fri, 11 Jan 2002 08:53:10 +0000 |
| Subject: | Re: Redeclaring functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80175@lists.php.net to get a copy of this message | ||
Arve Bersvendsen wrote:
As a small, personal, "enjoy-myself"-project I'd like to run a perpetual-running socket server. Problem is; I also want it to be self-modifying so I can insert, remove and change functions as the server is running. The problem is; under normal circumstances, PHP won't let the script redeclare functions. Is there any way to circumvent this.I dont know what a perpetual-running socket server is, but to have a main PHP script execute different functions with the same name I guess you could play with "include/require" directives or create classes with the same function-names you then pass to you main program (kind like poor-mans polymorphism :-)