Re: private functions
| From: | Richard Lynch | Date: | Sun, 09 Sep 2001 00:51:26 +0000 |
| Subject: | Re: private functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66558@lists.php.net to get a copy of this message | ||
You'll have to use the function to find out if the function is defined.
http://php.net/function_exists
You may want to mess with method_exists and try to define it as a method
rather than a global function, which is what I think you are doing at this
point.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Lukas <sofnologyREMOVE@xtra.co.nz>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Friday, September 07, 2001 5:34 PM
Subject: private functions
> 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
>
>
>
>