<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: goto in PHP</title>
	<atom:link href="http://www.procata.com/blog/archives/2004/07/29/goto-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/</link>
	<description>PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.</description>
	<lastBuildDate>Sat, 13 Mar 2010 17:00:56 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: drborsos</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84837</link>
		<dc:creator>drborsos</dc:creator>
		<pubDate>Tue, 26 Jan 2010 01:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84837</guid>
		<description>use goto by allmeans BUT variable functions in PHP are a lot cleaner and more powerful:
consider example:

first_block();               //runs first_block and then GOTO to default blank_function if($condition_is_met
first_block(&quot;second_block&quot;); //runs first_block and then GOTO to second_block if($condition_is_met
third_block(&quot;first_block&quot;);  //runs first_block and then GOTO to second_block if($condition_is_met)

function first_block($exitfunction=&quot;blank_function&quot;){
    if($condition_is_met){$exitfunction();}
}

function second_block($exitfunction=&quot;blank_fucntion&quot;){
   if($condition_is_met){$exitfunction();}
}

function third_block($exitfunction=&quot;blank_fucntion&quot;){
   if($condition_is_met){$exitfunction();}
}

function blank_function{return true;}</description>
		<content:encoded><![CDATA[<p>use goto by allmeans BUT variable functions in PHP are a lot cleaner and more powerful:<br />
consider example:</p>
<p>first_block();               //runs first_block and then GOTO to default blank_function if($condition_is_met<br />
first_block(&#8221;second_block&#8221;); //runs first_block and then GOTO to second_block if($condition_is_met<br />
third_block(&#8221;first_block&#8221;);  //runs first_block and then GOTO to second_block if($condition_is_met)</p>
<p>function first_block($exitfunction=&#8221;blank_function&#8221;){<br />
    if($condition_is_met){$exitfunction();}<br />
}</p>
<p>function second_block($exitfunction=&#8221;blank_fucntion&#8221;){<br />
   if($condition_is_met){$exitfunction();}<br />
}</p>
<p>function third_block($exitfunction=&#8221;blank_fucntion&#8221;){<br />
   if($condition_is_met){$exitfunction();}<br />
}</p>
<p>function blank_function{return true;}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Munch</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84808</link>
		<dc:creator>Frank Munch</dc:creator>
		<pubDate>Sat, 19 Dec 2009 16:25:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84808</guid>
		<description>- Listen, I am done in this building. How do I get to the restaurant?

- Leave this room, you&#039;ll see a step, step one floor down. If you were doing something in that room just end it, leave the room, go one floor down. If you were doing something there, end it and go one floor down. In that room you had asked somebody a question, receive the answer even if you don&#039;t need it anymore, now step one down again. You are now on the ground floor. Go straight forward. You will be asked if you want to turn right or left. Turn right, then go straight ahead. Now you are now at the restaurant! Enjoy.

- Thanks. But, eh, out of this window I can see a big sign where it says &quot;Restaurant&quot;. It is there?

- Yes!

- Why didn&#039;t you point and just tell me to go to there?

- No, we use structured language here. &quot;Go to&quot; is unprofessional and can so easily lead to confusion! You have walked to where you are in a structured way. Now you must leave in the same way.

- Really? I wish you could have made an exception in my case.

- Ah, an EXCEPTION! But did you TRY something? If so I will throw an exception, and if you have set up a CATCH, you will save a lot of time.

- So, I should go back an set up a TRY. Is that more structured?

- Far more. That is the pro way of doing it!

- But I am in a hurry. I will simply take the elevator down, and go to the restaurant.

- It&#039;s just so wrong. Nobody can have respect for that. Please Sir, do yourself a favor. Leave this room, you&#039;ll see a step, step one floor down. If you were doing something in that room...</description>
		<content:encoded><![CDATA[<p>- Listen, I am done in this building. How do I get to the restaurant?</p>
<p>- Leave this room, you&#8217;ll see a step, step one floor down. If you were doing something in that room just end it, leave the room, go one floor down. If you were doing something there, end it and go one floor down. In that room you had asked somebody a question, receive the answer even if you don&#8217;t need it anymore, now step one down again. You are now on the ground floor. Go straight forward. You will be asked if you want to turn right or left. Turn right, then go straight ahead. Now you are now at the restaurant! Enjoy.</p>
<p>- Thanks. But, eh, out of this window I can see a big sign where it says &#8220;Restaurant&#8221;. It is there?</p>
<p>- Yes!</p>
<p>- Why didn&#8217;t you point and just tell me to go to there?</p>
<p>- No, we use structured language here. &#8220;Go to&#8221; is unprofessional and can so easily lead to confusion! You have walked to where you are in a structured way. Now you must leave in the same way.</p>
<p>- Really? I wish you could have made an exception in my case.</p>
<p>- Ah, an EXCEPTION! But did you TRY something? If so I will throw an exception, and if you have set up a CATCH, you will save a lot of time.</p>
<p>- So, I should go back an set up a TRY. Is that more structured?</p>
<p>- Far more. That is the pro way of doing it!</p>
<p>- But I am in a hurry. I will simply take the elevator down, and go to the restaurant.</p>
<p>- It&#8217;s just so wrong. Nobody can have respect for that. Please Sir, do yourself a favor. Leave this room, you&#8217;ll see a step, step one floor down. If you were doing something in that room&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84632</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Thu, 06 Aug 2009 19:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84632</guid>
		<description>@jistanidiot
are you serious???
you can&#039;t think that really this goto is better to read than an else...
if this is your example, where you really need goto, than its ridiculous...

&lt;code&gt;
if ($error) {
print &quot;error message&quot;;
goto FOOTER;

} 

# do useful stuff here

FOOTER;
include(&quot;./graphicdesign/footer.inc&quot;);
&lt;/code&gt;

vs.

&lt;code&gt;
if ($error) {
print &quot;error message&quot;;
} 
else {
# do useful stuff here
}

include(&quot;./graphicdesign/footer.inc&quot;);
&lt;/code&gt;

I would really like to see a example with sence...</description>
		<content:encoded><![CDATA[<p>@jistanidiot<br />
are you serious???<br />
you can&#8217;t think that really this goto is better to read than an else&#8230;<br />
if this is your example, where you really need goto, than its ridiculous&#8230;</p>
<p><code><br />
if ($error) {<br />
print "error message";<br />
goto FOOTER;</p>
<p>} </p>
<p># do useful stuff here</p>
<p>FOOTER;<br />
include("./graphicdesign/footer.inc");<br />
</code></p>
<p>vs.</p>
<p><code><br />
if ($error) {<br />
print "error message";<br />
}<br />
else {<br />
# do useful stuff here<br />
}</p>
<p>include("./graphicdesign/footer.inc");<br />
</code></p>
<p>I would really like to see a example with sence&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wawa</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84599</link>
		<dc:creator>wawa</dc:creator>
		<pubDate>Tue, 30 Jun 2009 14:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84599</guid>
		<description>@Riccardo Tacconi

&#039;I thoguth it is a joke&#039;
thoguth

&#039;This is a clear sign of the low quality of the PHP community&#039;
It&#039;s reflects on the &quot;community&quot; poorly?

&#039;Spaghetti coder now are using classes and objects&#039;
Grammar.

&#039;How needs a goto statement?&#039;
Who&#039;s how?

&#039;easyness&#039;
is that like peasyness?

&#039;permits to everyone&#039;
lol

&#039;languages has&#039;
grammar

&#039;estblished&#039;
Taking abbreviations a little too seriously...

&#039;The goto in PHP is a clear sign of the wrong mantality of the PHP community sites.&#039;
This sounds familiar!

Okay, I&#039;m done &gt;&gt;</description>
		<content:encoded><![CDATA[<p>@Riccardo Tacconi</p>
<p>&#8216;I thoguth it is a joke&#8217;<br />
thoguth</p>
<p>&#8216;This is a clear sign of the low quality of the PHP community&#8217;<br />
It&#8217;s reflects on the &#8220;community&#8221; poorly?</p>
<p>&#8216;Spaghetti coder now are using classes and objects&#8217;<br />
Grammar.</p>
<p>&#8216;How needs a goto statement?&#8217;<br />
Who&#8217;s how?</p>
<p>&#8216;easyness&#8217;<br />
is that like peasyness?</p>
<p>&#8216;permits to everyone&#8217;<br />
lol</p>
<p>&#8216;languages has&#8217;<br />
grammar</p>
<p>&#8216;estblished&#8217;<br />
Taking abbreviations a little too seriously&#8230;</p>
<p>&#8216;The goto in PHP is a clear sign of the wrong mantality of the PHP community sites.&#8217;<br />
This sounds familiar!</p>
<p>Okay, I&#8217;m done &gt;&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riccardo Tacconi</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84598</link>
		<dc:creator>Riccardo Tacconi</dc:creator>
		<pubDate>Thu, 25 Jun 2009 09:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84598</guid>
		<description>Good article and good quality. I want to outline the end of the article:

&lt;q cite=&quot;Perhaps worst of all, I think having goto will cause serious programmers to take PHP less seriously as a language.&quot;&gt;

My respect for PHP is going down and down. I thoguth it is a joke, but in PHP 5.3 there is goto. This is a clear sign of the low quality of the PHP community, especially compared to Java, Python, Ruby, Groovy etc.

Spaghetti coder now are using classes and objects, but their mentality is still the same. How needs a goto statement? Spaghetti coders. The easyness of PHP permits to everyone to use it and there are some drawbacks from this.

While the other languages has a clear syntax, a well estblished error management, real OOP capabilities, PHP has a different error management for different functions, not overloading/polymorphism...

The goto in PHP is a clear sign of the wrong mantality of the PHP community sites. 

This confirms that I will use a different language in the future.&lt;/q&gt;</description>
		<content:encoded><![CDATA[<p>Good article and good quality. I want to outline the end of the article:</p>
<p><q cite="Perhaps worst of all, I think having goto will cause serious programmers to take PHP less seriously as a language."></p>
<p>My respect for PHP is going down and down. I thoguth it is a joke, but in PHP 5.3 there is goto. This is a clear sign of the low quality of the PHP community, especially compared to Java, Python, Ruby, Groovy etc.</p>
<p>Spaghetti coder now are using classes and objects, but their mentality is still the same. How needs a goto statement? Spaghetti coders. The easyness of PHP permits to everyone to use it and there are some drawbacks from this.</p>
<p>While the other languages has a clear syntax, a well estblished error management, real OOP capabilities, PHP has a different error management for different functions, not overloading/polymorphism&#8230;</p>
<p>The goto in PHP is a clear sign of the wrong mantality of the PHP community sites. </p>
<p>This confirms that I will use a different language in the future.</q></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84588</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 17 Jun 2009 14:07:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84588</guid>
		<description>First, Let me agree that most programmers should avoid goto like the plague.  They&#039;ll almost always screw things up using it.

Having said that, there is *one* good reason for adding goto, and that is for compilers that target PHP.  For example, a good functional language like Haskell does things like tail-recursion optimization.  Now in trivial cases, you can translate tail-recursion into a simple while loop, but in cases where you&#039;re dealing with mutually recursive functions, a while loop doesn&#039;t cut it.</description>
		<content:encoded><![CDATA[<p>First, Let me agree that most programmers should avoid goto like the plague.  They&#8217;ll almost always screw things up using it.</p>
<p>Having said that, there is *one* good reason for adding goto, and that is for compilers that target PHP.  For example, a good functional language like Haskell does things like tail-recursion optimization.  Now in trivial cases, you can translate tail-recursion into a simple while loop, but in cases where you&#8217;re dealing with mutually recursive functions, a while loop doesn&#8217;t cut it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alphy</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84584</link>
		<dc:creator>Alphy</dc:creator>
		<pubDate>Sat, 13 Jun 2009 08:07:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84584</guid>
		<description>I&#039;ve been using PHP for several months now, and it&#039;s been enough of a struggle that I&#039;ve started to look for other alternatives.  The one I&#039;ve liked the most so far is Haskell.

Haskell doesn&#039;t have GOTO statements.  Nor does it have for or while loops (you are strictly limited to recursion).  Nor can you change a variable once you have assigned it a value.

Nonetheless, you can do wonderful things in Haskell!  Indeed, by getting rid of variables, it becomes a lot easier to debug programs, because functions generally don&#039;t have &quot;side effects&quot; that do weird things, like unexpected changing of global variables.

If only it didn&#039;t take so long to get used to the syntax...</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using PHP for several months now, and it&#8217;s been enough of a struggle that I&#8217;ve started to look for other alternatives.  The one I&#8217;ve liked the most so far is Haskell.</p>
<p>Haskell doesn&#8217;t have GOTO statements.  Nor does it have for or while loops (you are strictly limited to recursion).  Nor can you change a variable once you have assigned it a value.</p>
<p>Nonetheless, you can do wonderful things in Haskell!  Indeed, by getting rid of variables, it becomes a lot easier to debug programs, because functions generally don&#8217;t have &#8220;side effects&#8221; that do weird things, like unexpected changing of global variables.</p>
<p>If only it didn&#8217;t take so long to get used to the syntax&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FLiFnotes &#187; goto in PHP</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84500</link>
		<dc:creator>FLiFnotes &#187; goto in PHP</dc:creator>
		<pubDate>Tue, 14 Apr 2009 04:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84500</guid>
		<description>[...] over some comments on goto use, one of the concerns I find most interesting is that of the kitchen sink mentality. Personally, I [...]</description>
		<content:encoded><![CDATA[<p>[...] over some comments on goto use, one of the concerns I find most interesting is that of the kitchen sink mentality. Personally, I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ALICE</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84432</link>
		<dc:creator>ALICE</dc:creator>
		<pubDate>Mon, 23 Feb 2009 20:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84432</guid>
		<description>High Level codes already known ideas.  And it works up until it just does not work anymore.  When you need something new, you need Low Level control, you need GOTO. Else you may find yourself trying lines and lines and lines of code that just does not quite make it, and fails, but the solution is just one simple GOTO command that does perfectly in so few lines of code. &lt;code&gt;/* I put this one GOTO here because ... */&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>High Level codes already known ideas.  And it works up until it just does not work anymore.  When you need something new, you need Low Level control, you need GOTO. Else you may find yourself trying lines and lines and lines of code that just does not quite make it, and fails, but the solution is just one simple GOTO command that does perfectly in so few lines of code. <code>/* I put this one GOTO here because ... */</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP: Spaghetti alla Bolognese &#171; PHP::Impact ( [str Blog] )</title>
		<link>http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84376</link>
		<dc:creator>PHP: Spaghetti alla Bolognese &#171; PHP::Impact ( [str Blog] )</dc:creator>
		<pubDate>Fri, 09 Jan 2009 10:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/07/29/goto-in-php/#comment-84376</guid>
		<description>[...] think having goto will cause serious programmers to take PHP less seriously as a language.&#8221; - Jeff Moore, July 29th 2004 Possibly related posts: (automatically generated)Aptana PHP Eclipse: The [...]</description>
		<content:encoded><![CDATA[<p>[...] think having goto will cause serious programmers to take PHP less seriously as a language.&#8221; &#8211; Jeff Moore, July 29th 2004 Possibly related posts: (automatically generated)Aptana PHP Eclipse: The [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
