Re: switch labels in sub-blocks

From: Date: Sat, 29 May 2004 15:16:35 +0000
Subject: Re: switch labels in sub-blocks
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-10173@lists.php.net to get a copy of this message
Sara Golemon wrote:
Well, now that I think I understand what is it for, I'm pretty sure it's not very appropriate for PHP(, unless someone will provides an example of the opposite of course). It's kind of clarity vs efficiency. The more the basic operation ("*to = *from++" in the original) is getting bigger (slower) the efficiency gain becomes smaller (correct?) so I would prefer clarity here. I'm not even sure real example in PHP will have close to 50% speed gain.
In the case of "Duff's Device" it certainly isn't applicable to PHP That was my guess, you approved it.
....It much for efficient for the engine to process a complex single opcode than to process many simple opcodes in succession. That still doesn't speak to whether or not there aren't truly applicable examples. It looks like it worked just fine for that
example in _C_.
Functionally the parser doesn't want to see overlapping structures like this and it feel non-trivial to implement. But I havn't looked at the switch implementation close enough to be certain yet. For the sake of readability I'm -1. Agreed on that.
That's what I was originally talking about. It was phrased as "messy".
I'd sooner see goto implemented than this. And I don't care for that either. -Sara


« previous php.internals (#10173) next »