Re: Exceptions and builtin functions in PHP5
| From: | Greg Beaver | Date: | Thu, 08 Apr 2004 14:53:55 +0000 |
| Subject: | Re: Exceptions and builtin functions in PHP5 | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182831@lists.php.net to get a copy of this message | ||
The exception mechanism will not replace trigger_error() or function return values any time soon
Greg
Tumurbaatar S. wrote:
<daniel@electroteque.org> wrote in message news:49201.203.15.102.65.1081404627.squirrel@www.electroteque.org...In the current version of PHP, many built-in functions (if not all?) return FALSE on an error and some resource/handle on a success. So, instead of coding like this: ...If I understand right, PHP5 has an exception handling mechanism but it is only for "manual" using, i.e. a programmer can use try/catch but only for own code. PHP's built-in functions and functions from extensions still use old "return value" method. Yes? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI bloody hope not or what is the point ?$res = some_builtin_func(); // func does not raise exception on error if (!$res) throw new Exception(); // so I throw it manually... I want to write: ...$res = some_builtin_func(); // func raises exception on error// so I don't need to write additional lines ... So will PHP5 (or future versions) work as in my 2nd example?