Re: Exceptions and Errors
| From: | Christian Schneider | Date: | Thu, 15 Apr 2004 11:15:03 +0000 |
| Subject: | Re: Exceptions and Errors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals php.internals |
| Request: | Send a blank email to internals+get-9174@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
I don't think allowing the return of anything except for the object itself is *fixing* PHP.No, being able to fail and return would not be fixing it. It would be extending it to allow people to avoid exceptions for this simple case.
For example, in the SOAP extension it is very useful that in the SoapServer you can throw an exception and that'll create a SOAP error. Any other value you return will be the SOAP result. This is a perfect place for exceptions.I tempted to challenge you to give me an example usage which I could rewrite without exceptions, making it simpler and/or fixing problems ;-) - Chris