I've just recently started using PHP 5.4 and have noticed as of 5.3 you can use goto to jump to sections of code which I am using to jump from a loop section. My question is after having read this post... Is GOTO in PHP evil? is this bad practice in this case or is it a viable solution?
<?php
while ($thisResult = mysql_fetch_array($result)) {
if($article && $i > 0) {
goto comments;
}
?>
<h2>
<a href="/plugins/<?=$thisResult['post_name']?>"><?=$thisResult['post_title']?></a>
<span><?=$thisResult['post_modified_gmt']?></span>
</h2>
<p class="content">
<?=nl2br($thisResult['post_content']);?>
</p>
<br />
<?php
comments:
if ($article) {
?>
<p class="comment"><?=$thisResult['comment_content']?>
<?php
}
$i++;
}
?>