Jump to content

Labels in PHP


FIONEX

Recommended Posts

Hey, I was wondering if PHP supports labels, but I doubt they're called labels because I've searched and couldn't find anything.

Labels in VB or other languages for that matter look like this:

RepeatCode:
'CODE GOES HERE
If A > B Then GoTo RepeatCode

Does anyone know what I'm talking about?
If you do, is this possible in PHP kuz I'm in need of them.
Link to comment
https://forums.phpfreaks.com/topic/11609-labels-in-php/
Share on other sites

[!--quoteo(post=382042:date=Jun 9 2006, 09:32 PM:name=Fyorl)--][div class=\'quotetop\']QUOTE(Fyorl @ Jun 9 2006, 09:32 PM) [snapback]382042[/snapback][/div][div class=\'quotemain\'][!--quotec--]
It's only really needed for linear code. If you do a few tutorials on this site you'll see that even linear code isn't actually linear.
[/quote]

It isn't *needed* at all. Plus I've seen it abused too many times, even in commercial packages.

Such as

- leaping out of for() loops to some other part of the program

- and even

[code]statement1
statement2
goto LABEL
function x()
     thought I'd define a function now
end function
LABEL:
Statement3[/code]
Link to comment
https://forums.phpfreaks.com/topic/11609-labels-in-php/#findComment-43840
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.