Re: Breaking up data efficiently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin L'Huillier wrote:
...
Create the function split_location to return the associative array or,
if it is invalid, throws an exception.  If PHP4, replace the exception
with similar error handling.

If efficiency is really the goal, then the OP probably shouldn't go the route of Exceptions. Just use a simple trigger_error() and your php.ini to direct where the error messages go. Especially in this case... because errors here are likely just because someone added / removed an extra "|" where it didn't belong.

In my opinion you should save exceptions for, well, EXCEPTIONal problems. Either that or you use exceptions for a large system that discriminates against specific types of errors and handles each error type in a totally different way. Can we say bloat?

--
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux