[PHP] Re: redeclaring functions
And sorry but no, I can't just delete one of the functions...these scripts are used in many other places by themselves without the other..so script A has to be able to have this function on its own page, and so does script B on its own page. Taylor York [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am having a problem with two scripts that use the same function name. The two functions do the exact same thing...but when the include files are called, the second file recieves a redeclare error. Suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: redeclaring functions
And sorry but no, I can't just delete one of the functions...these scripts are used in many other places by themselves without the other..so script A has to be able to have this function on its own page, and so does script B on its own page. And sorry but no, you can't have two functions with the same name. Period. Use some logic when you're programming and rethink your solution. Use function_exists() before each function declaration so you don't declare it twice? Are both functions exactly the same? ---John Holmes.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Redeclaring functions
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 :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Redeclaring functions
Martin Wickman wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: 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 I'm thinking about a server that can keep it's connection up running, even if I decide to change the internal functionality of functions, or even adding functions on-the-fly. -- Arve URL:http://www.bersvendsen.com/ Newsere mot X-No-Archive URL:http://www.ibiblio.org/Dave/Dr-Fun/df9601/df960124.jpg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]