FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » The goto statement in PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: The goto statement in PHP [message #185777 is a reply to message #185776] Wed, 07 May 2014 19:16 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <lke0a8$gcs$1(at)news(dot)albasani(dot)net>, The Natural Philosopher
<tnp(at)invalid(dot)invalid> wrote:

> On 07/05/14 16:13, Graham Hobbs wrote:
>> On Mon, 05 May 2014 10:27:36 -0400, Jerry Stuckle
>> <jstucklex(at)attglobal(dot)net> wrote:
>>
>>> On 5/5/2014 9:50 AM, richard wrote:
>>>> In Liberty BASIC (LB) we also have branched goto labels.
>>>> As I was reading the goto manual on php.net I see where they make no
>>>> distinction between a label and a variable.
>>>> In LB it is simple.
>>>> a=0 is a distinct variable.
>>>> [a] is a distinct label.
>>>>
>>>> When goto [a] is encountered, it matters not what or where the variable
>>>> "a"
>>>> is.
>>>>
>>>> I'm just suggesting that they need a means to distinguish the pair.
>>>>
>>>
>>> Better yet - don't use goto. I never have needed it.
>> Just reminds me of the 'sphagetti' code' days.
>
> I have never NEEDED it above assembler code, it but I have occasionally
> USED it.
>
> I think its possible to say that its almost impossible to get away
> without it at assembler level.

Well, in assembler it'll just be a JMP or equivalent, won't it.

> Sometimes 'Go To jail: go directly to jail, do not pass Go, do not
> collect £200' is exactly the simplest way to express something.

I once worked with a FORTRAN compiler that gave exactly that message if
you put:

GOTO JAIL

> I've always felt Dijkstra was a bit of a Dijk...frankly.

Did he also try to insist on single-entry-single-exit for functions?
I've never paid any attention to that; early return for error
conditions is the way to do it.

--
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: part two same issue - unwanted empty values in array
Next Topic: richard
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 03:36:18 GMT 2024

Total time taken to generate the page: 0.04708 seconds