Re: GOTO and/or BREAK LABEL

From: Date: Tue, 07 Mar 2006 15:10:39 +0000
Subject: Re: GOTO and/or BREAK LABEL
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Dmitry Stogov wrote:
> Hi,
> 
> Because of some confused people I reverted "break label" patch and post it
> for discussion once again together with GOTO patch.
> 
> Please reviw and vote.
> 
> 1) goto and break label
> 2) goto only (like C)
> 3) break label only (like Java)
> 4) nothing

For what it is worth:

1) +0.5
2) +1
3) +0
4) -1

I don't see any real benefit to break label as the deepest I have ever
seen is 3 levels of break.  I have run up against too many situations
where the only way to lex something effectively in PHP is with pcre.
The ability to port a tool like re2c would make it far easier to do
things efficiently without having to write a new PHP extension.  I doubt
any users will suddenly start peppering goto all over their source, I
just can't see that happening when there are so many other great loop
constructs available.  Discouraging its use is easy - just make sure the
manual makes it really unattractive and has examples of better ways to
implement goto using for/foreach/while.

Greg


Thread (106 messages)

« previous php.internals (#22200) next »