[thelist] Alternative Control Structure Syntax in PHP

Hershel Robinson hershel at galleryrobinson.com
Tue Aug 29 13:30:48 CDT 2006

You may be familiar with the alternative 'colon' syntax of PHP control 

<?php if ($a == 5): ?>
A is equal to 5
<?php endif; ?>

A certain PHP team leader said to me:

 >   we always discourage the use of : as per recommendations of PHP team
 > and also due to the fact that this syntax is not folded properly in
 > several editors

How do people feel about this? I am writing coding guidelines for a team 
and I must decide whether or not to allow this syntax. I personally like 
it in cases as above where the block extends beyond the ending ?> tag.

But it seems there are reasons against it as well.


Web Site Construction by Gallery Robinson

More information about the thelist mailing list