Re: GOTO operator

From: Date: Fri, 30 Jul 2004 19:05:10 +0000
Subject: Re: GOTO operator
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-11711@lists.php.net to get a copy of this message
At 11:56 AM 7/30/2004 -0700, Sara Golemon wrote:
The C# goto is limited: "goto statements can transfer control within blocks and out of blocks, but never into blocks." Does the PHP goto implementation have this limitation?
No it doesn't. As I mentioned Sara's implementation is extremely flawed. So yes there is a technical issue here beside a semantic issue. And the C# limitation might very well apply in PHP too. Flag on the play.... Yes it *DOES* have this limiter as I've stated at least 4 times on this list and in the patch description itself. I can't tell you how encouraging it is to hear counter-arguments from people who havn't taken the time to explore the topic at hand. I would love to hear what these flaws are so that I can fix them. Regardless of whether or not GOTO is added to PHP I'd like to improve my ability to maintain and work on the language efficiently.
Hi Sara, I thought you were aware of the problems (that's what I understood from you). I guess I got the wrong idea and in no way meant to insult your work. A few problems: a) Performance wise the right thing to do is to use static labels and pre-compute them during compile-time (I remembered you were aware of that). b) We therefore should not require an additional opcode for goto. c) I don't think you are creating the necessary switch_free's and other frees when jumping out of a scope unexpectedly. d) Due to (c) it would make it pretty much impossible to jump into code blocks (i.e. the C# example). Again, I in know way meant to offend you, I just got the impression you were aware of some of these problems and just did it for fun. Andi

« previous php.internals (#11711) next »