Re: [PHP-DEV] A better error handling approach.

2013-05-02 Thread Adam Jon Richardson
On Fri, May 3, 2013 at 2:08 AM, Sherif Ramadan wrote: > It's already possible to do so now without any modifications to the core: It was already possible to declare arrays, but the new, shorter array syntax still brings a smile to my face :) Few new language features actually add things that were

Re: [PHP-DEV] A better error handling approach.

2013-05-02 Thread Sherif Ramadan
On Fri, May 3, 2013 at 1:25 AM, Adam Jon Richardson wrote: > > > Currently, sure. Limiting this functionality to the return statement > seems doable. > It's already possible to do so now without any modifications to the core: function myFunc() { $result = array(null, null); if ($failureCa

Re: [PHP-DEV] A better error handling approach.

2013-05-02 Thread Adam Jon Richardson
On Thu, May 2, 2013 at 11:44 PM, Sherif Ramadan wrote: > > Just to clarify, PHP doesn't offer two separate approaches of handling > errors. We need to first distinguish between what is meant by a the terms > "Errors" and "Exceptions" so that we don't throw around ambigous claims > here. PHP has an

Re: [PHP-DEV] A better error handling approach.

2013-05-02 Thread Sherif Ramadan
On Thu, May 2, 2013 at 6:00 PM, Adam Jon Richardson wrote: > PHP currently has two separate approaches to handling errors: > - Errors > - Exceptions > > Both have their issues. > > Just to clarify, PHP doesn't offer two separate approaches of handling errors. We need to first distinguish between w

Re: [PHP-DEV] A better error handling approach.

2013-05-02 Thread Adam Jon Richardson
On Thu, May 2, 2013 at 6:46 PM, Stuart Langley wrote: > So is the feature you're describing is tuples and a use case of that feature > is an easier way to do error handling? No. Tuples are an implementation detail specific to how Python allows one to conveniently return multiple values. I merely

Re: [PHP-DEV] A better error handling approach.

2013-05-02 Thread Stuart Langley
So is the feature you're describing is tuples and a use case of that feature is an easier way to do error handling? On Fri, May 3, 2013 at 8:00 AM, Adam Jon Richardson wrote: > PHP currently has two separate approaches to handling errors: > - Errors > - Exceptions > > Both have their issues. > >

[PHP-DEV] A better error handling approach.

2013-05-02 Thread Adam Jon Richardson
PHP currently has two separate approaches to handling errors: - Errors - Exceptions Both have their issues. Using and responding to errors requires that the returned value (if there is one) perform double duty as both a potential valid response AND, in the case of error, a flag that something wen