private functions

From: Date: Fri, 07 Sep 2001 22:34:25 +0000
Subject: private functions
Groups: php.general 
Request: Send a blank email to php-general+get-66496@lists.php.net to get a copy of this message
Hello, Sorry, i posted this to my local newsfeed a while ago but i don't think it is propogating properly, however i apologise if this appears twice. --- i've been using private functions like the code below a little, and just discovered that if you call the outside function more than once you get an error. Apparently it doesn't like redeclaring the inside function the second time you call the outside function... this seems strange to me. Any help would be appreciated. <? function foo(){ function private_to_foo(){ echo("this is private to foo\n"); } // call my private function echo("Hello, calling my private function....\n"); private_to_foo(); } // call our function echo("About to call foo\n"); foo(); // if you call it again it dies foo(); ?> Lukas

« previous php.general (#66496) next »