Using colon instead of curly-braces { } with conditionals

From: David M.
Sent on: Thursday, March 19, 2009 5:43 PM
Came across this blog entry and it got me wondering...
http://www.codediesel.com/php/the-benefits-of-the-colon-syntax-for-control-structures/

The premise of the article is that when code gets big and nested, using curly-braces can get troublesome.  Instead, PHP can handle a colon followed by an END__

For example:
    if ($something == 'true') :
        $aBunchOfCodeHere = 'yes';
    endif;

Using NetBeans (like Eclipse and I'm assuming other IDEs) means I can 'see' what conditional/line each closing-curly-brace  }   is associated with.

Since I'm curious, though, I'm wondering if there is ever a time when any of y'all use the colon method?


David

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy