Jump to content

loop:{ if(true) {goto:loop;}}//PHP 5.3

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
22 replies to this topic

#1
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Why do you think they are adding a age old function that is hardly ever used today?

PHP: goto - Manual

They have a cool picture:
Posted Image

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Ehh, makes me want to puke. I've never been in a circumstance where I had to "restructure the program flow" or simply use goto. I can only picture the code I'll run into now, as if it wasn't bad enough what some PHP programmers produce. I can't even stand the exception that allows if conditions to use a : instead of brackets....

I don't know why they have added it but hells fire I hope they remove it in 6.1.

#3
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
I like the brackets a lot actually, I do not see it as much more than a function though, it just seems a bit odd.

I bet they will introduce something to go along with it.

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Like what? A magic _goto function for classes? lol

#5
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
No :P

I mean if you do something like:

$i = 0;
goto: Codecall;
echo "This will not show up";
CodeCall: {
	if($i < 10) {
		$i++;
		goto: Codecall;
	}
}
echo "\$i = 10;";

It just seems like a odd looking function or something lol

I have not tested this, the server I have remote access to is 5.2.8

#6
relapse

relapse

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 476 posts
I've already cussed this cursed function and PHP's ignorance for adding it somewhere. I think it is ******* retarded that they are adding it at this version while every other language in the world is going away from it. Are they stupid?

#7
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Well, I wonder what functions they are going to use with it so that it works efficiently? I am sure they are not just adding it for laughs.

Maybe they are trying to make it more compatible with an older language trying to get that market share? Rewriting code with a lot of "goto"'s in it would be difficult without gotos lol

#8
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Proper code shouldn't be written with "gotos" so I don't know why anyone would want to convert said code.

#9
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Well I mean like older languages that do not contain structure. (if, else if, else, while, for)

#10
Guest_Jordan_*

Guest_Jordan_*
  • Guests
lol, what?

#11
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Nevermind lol... they even have a comefrom!

PHP: comefrom - Manual

#12
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The only language I've coded in that required goto was MS-Basic. It's been proven that GOTO statements are unnecessary with loops and if statements available. Spaghetti code proves they're evil.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog