Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]
| From: | Zeev Suraski | Date: | Mon, 31 Mar 2003 08:53:34 +0000 |
| Subject: | Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR] | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-528@lists.php.net to get a copy of this message | ||
At 11:35 31/03/2003, Per Lundberg wrote:
On Sat, 2003-03-29 at 12:59, Zeev Suraski wrote: Remember that we don't want to encourage exception based programming anyway. Catching an exception should typically be the last thing done in a program, right before it terminates. Writing exception-driven applications is extremely discouraged. What is the rationale behind this?(a) This is very much the case for all languages that have exceptions. Exception handling is *slow*. Coding exception-driven apps in Java and C++ is a bad idea too. Exceptions were designed to handle errors, and not provide some nifty way of shifting control from one place to another. (b) In PHP, exception handling results in memory leaks. Like all leaks in PHP, they'd be taken care of at the end of the request. Until the end of the request, however, certain chunks of memory will not be reclaimed. Zeev