Sara Golemon | 1 Aug 2004 02:44
Picon

Re: [PHP-DEV] GOTO operator

> How does the GOTO implementation handle this
> script1.php
> <?php
>
> do_some_stuff();
> include script2.php;
>
> label:
>    echo "Hello"
> ?>
>
> script2.php:
> <?php
>    declare_some_funcs();
>     .... some code ...
>     if (some_cond) {
>        goto label;
>      }
>     .... other code....
> ?>
>
Included files are actually separate execution scopes (even though they're
shared data scope).  So the implementation referenced originally would raise
an error saing that 'label' is an undefined label.

-Sara

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
(Continue reading)

Sterling Hughes | 1 Aug 2004 03:13
Picon

Re: [PHP-DEV] GOTO operator

i'm just piping up that i'm a strong +1 on goto, its immensely useful
for code generators, like for example a gui application that wanted to
generate some type of php code.

also, when you start quoting djikstra in a php context, you've lost.  

goto is fine, fight the power!

-sterling

On Sat, 31 Jul 2004 17:44:07 -0700, Sara Golemon <pollita <at> php.net> wrote:
> > How does the GOTO implementation handle this
> > script1.php
> > <?php
> >
> > do_some_stuff();
> > include script2.php;
> >
> > label:
> >    echo "Hello"
> > ?>
> >
> > script2.php:
> > <?php
> >    declare_some_funcs();
> >     .... some code ...
> >     if (some_cond) {
> >        goto label;
> >      }
> >     .... other code....
(Continue reading)

Cris H | 1 Aug 2004 21:59
Picon
Favicon

Re: [PHP-DEV] GOTO operator

 --- Sterling Hughes <sterling.hughes <at> gmail.com> wrote: 

> also, when you start quoting djikstra in a php context, you've
> lost.  
> 
> goto is fine, fight the power!

s/quoting djikstra/mentioning state machines/

also

s/quoting djikstra/agonising about the algorithmic efficiency of
goto versus switch/

Not that I fully believe the above substitutions, but you see
the point. Currently -0.25 on goto.

regards,

Cris

	
	
		
___________________________________________________________ALL-NEW Yahoo! Messenger - all new
features - even more fun!  http://uk.messenger.yahoo.com

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
(Continue reading)


Gmane