Aureole Posted November 30, 2007 Share Posted November 30, 2007 PHP 6 has... goto. Now I don't claim to know much about programming in general but I do get around. Message/bulletin boards, news groups etc. etc. and from the thousands of posts/topics/articles I have read over the last 3 Years... people really seem to hate goto. I'm not saying if it's good or bad, I've never used it as I only know some PHP just wondering what other people think... I saw a discussion on them adding it on another PHP forum and people were going crazy, it was one heated debate. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/ Share on other sites More sharing options...
roopurt18 Posted November 30, 2007 Share Posted November 30, 2007 There is no reason to use goto. Ever. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403145 Share on other sites More sharing options...
trq Posted November 30, 2007 Share Posted November 30, 2007 PHP 6 has... goto. I doupt it. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403180 Share on other sites More sharing options...
roopurt18 Posted November 30, 2007 Share Posted November 30, 2007 Hmmm...I don't think I like the break label thing either; I hope they don't implement it. I will concede that there may be rare occasions where it might be useful, although I myself have never thought, "Hey I could really use a break label right now." The problem is that you can't prevent programmers from using it where it's not appropriate, which will lead to abusing the use of the construct and sloppy code will follow anyways. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403209 Share on other sites More sharing options...
fert Posted December 1, 2007 Share Posted December 1, 2007 Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403338 Share on other sites More sharing options...
neylitalo Posted December 1, 2007 Share Posted December 1, 2007 I always love a good dose of xkcd, and that comic expresses my opinions on goto to a T. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403350 Share on other sites More sharing options...
Azu Posted December 1, 2007 Share Posted December 1, 2007 There is no reason to use goto. Ever. It would be cool to be able to use goto in PHP. Just for the fun of it. Speaking of PHP functions that have to do with line numbers.. I wander if there is one that outputs the current line number? Could be useful for debugging. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403453 Share on other sites More sharing options...
PFMaBiSmAd Posted December 1, 2007 Share Posted December 1, 2007 The last question is easy. Yes there is - Magic constants PHP provides a large number of predefined constants to any script which it runs. Many of these constants, however, are created by various extensions, and will only be present when those extensions are available, either via dynamic loading or because they have been compiled in. There are five magical constants that change depending on where they are used. For example, the value of __LINE__ depends on the line that it's used on in your script. These special constants are case-insensitive and are as follows: Table 13.1. A few "magical" PHP constants Name Description __LINE__ The current line number of the file. ... Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403455 Share on other sites More sharing options...
roopurt18 Posted December 1, 2007 Share Posted December 1, 2007 It would be cool to be able to use goto in PHP. Just for the fun of it. I don't know. The way you go on about optimizing and not using white space because it's a waste of bytes, I would have thought you'd have been against a text string (the label) that doesn't perform any calculations. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403471 Share on other sites More sharing options...
Aureole Posted December 1, 2007 Author Share Posted December 1, 2007 Well from what I hear, goto would make it much easier to perform error checking and to write parsers. On my travels around the 'net that's the only good thing I've heard about it. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403677 Share on other sites More sharing options...
Azu Posted December 1, 2007 Share Posted December 1, 2007 It would be cool to be able to use goto in PHP. Just for the fun of it. I don't know. The way you go on about optimizing and not using white space because it's a waste of bytes, I would have thought you'd have been against a text string (the label) that doesn't perform any calculations. I just meant for fun lol not for a live website. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403717 Share on other sites More sharing options...
roopurt18 Posted December 1, 2007 Share Posted December 1, 2007 Well from what I hear, goto would make it much easier to perform error checking and to write parsers. On my travels around the 'net that's the only good thing I've heard about it. A parser is just a FSM that returns tokens based on syntax rules. They're already very easy to write. I really can't see how error checking would be made any easier: if($bad_thing_happened){ goto err_label; } // hundreds of lines of code err_label: echo "An error occured!"; vs. if($bad_thing_happened){ // throwing an exception // calling a error handler function // etc. } Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-403796 Share on other sites More sharing options...
Crew-Portal Posted December 3, 2007 Share Posted December 3, 2007 Okay. Im sorry for being a n00b. But what does goto mean? I know how its used in making batch files but does it do the same thing in PHP? Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-404681 Share on other sites More sharing options...
roopurt18 Posted December 3, 2007 Share Posted December 3, 2007 goto does the same thing in all languages that have it; it unconditionally jumps to another point in the code. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-404754 Share on other sites More sharing options...
Azu Posted December 3, 2007 Share Posted December 3, 2007 Goto in batch files is like calling a function. Goto in PHP goes to a line number. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-404896 Share on other sites More sharing options...
trq Posted December 3, 2007 Share Posted December 3, 2007 Goto in PHP goes to a line number. There currently is no GOTO in PHP nor (IMO) is there likely to become one in the near future. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405414 Share on other sites More sharing options...
Crew-Portal Posted December 3, 2007 Share Posted December 3, 2007 Gotoacha! lol Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405443 Share on other sites More sharing options...
Azu Posted December 4, 2007 Share Posted December 4, 2007 PHP 6 has... goto. Nobody contradicted that statement, and everybody seems to have been replying as if it is true, so I did the same. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405796 Share on other sites More sharing options...
GingerRobot Posted December 4, 2007 Share Posted December 4, 2007 PHP 6 has... goto. Nobody contradicted that statement, and everybody seems to have been replying as if it is true, so I did the same. I was under the impression that nearly everyone had contradicted that statement, since the possible implimentation will be different to the goto of other languages and wouldn't be called goto. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405831 Share on other sites More sharing options...
Azu Posted December 4, 2007 Share Posted December 4, 2007 PHP 6 has... goto. Nobody contradicted that statement, and everybody seems to have been replying as if it is true, so I did the same. I was under the impression that nearly everyone had contradicted that statement, since the possible implimentation will be different to the goto of other languages and wouldn't be called goto. Really? Then please quote the posts that do so. I haven't seen anybody contradict his statement of there being a goto function in PHP 6. All I've seen here is people saying that they don't like goto. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405879 Share on other sites More sharing options...
GingerRobot Posted December 4, 2007 Share Posted December 4, 2007 Hmm, lets try the post that directs to the minutes of the php 6 development meeting. PHP 6 has... goto. I doupt it. Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405902 Share on other sites More sharing options...
Azu Posted December 4, 2007 Share Posted December 4, 2007 One person!=nearly everyone. [offtopic]doubt* not doupt. ^^[/offtopic] Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405911 Share on other sites More sharing options...
GingerRobot Posted December 4, 2007 Share Posted December 4, 2007 Indeed it does not. However, i feel that something from the official php website DOES constitute proof that goto is not currently planned for implementation. Furthermore, i've not actually seen anyone explicitly agree that php has goto. You say people have been postin 'as if it is true'. However, it appears to me that only you have been posting 'as if it is true' Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-405914 Share on other sites More sharing options...
Aureole Posted December 5, 2007 Author Share Posted December 5, 2007 Well I heard it was planned for PHP6, my mistake... Quote Link to comment https://forums.phpfreaks.com/topic/79520-php-6-has/#findComment-407071 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.