Ben Sgro (ProjectSkyLine) wrote:
I see ample use of try/catch. Why? Why is it better/different than if/else?

You are talking about two completely different things here. If/else is for testing a condition. Try/catch is for handling exceptions. If an exception is thrown within a try/catch block the code in the catch section will be executed. The two are not interchangeable. You should read up on exception handling if you think you may need to use try/catch.

http://us2.php.net/manual/en/language.exceptions.php

--
Scott Mattocks
Author: Pro PHP-GTK
http://www.crisscott.com
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to