Re: local function?
| From: | Ryan Adams | Date: | Fri, 23 Jun 2000 18:43:19 +0000 |
| Subject: | Re: local function? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2843@lists.php.net to get a copy of this message | ||
You might try reorganizing your functions. Don't know exactly what you're
working on so this may not be an option...
function blah ($item) {
echo "<li> $item";
}
function foo() {
blah ("foo");
}
function bar() {
blah ("bar");
}
hth,
Ryan
On Thu, Jun 22, 2000 at 03:07:26PM -0500, indrek siitan wrote:
> Hi,
>
> is there a possibility to get the above code working without getting
> the "cannot redeclare blah()" error?
>
> --- 8< ---
>
> <?
>
> function foo() {
> function blah() { echo '<LI> foo'; }
> blah();
> }
>
> function bar() {
> function blah() { echo '<LI> bar'; }
> blah();
> }
>
> foo();
> bar();
>
> ?>
>
> --- 8< ---
>
> it's not ofcourse what i'm exacly needing, but it should describe
> the problem good enough - is there a possibility do declare a
> function that's not global?
>
>
> Rgds,
> Tfr
>
> --==< tfr@cafe.ee >==< http://tfr.cafe.ee/
> >==< +1-504-4467425 >==--
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
---end quoted text---