Re: A better error handling approach.
| From: | Adam Jon Richardson | Date: | Fri, 03 May 2013 06:33:58 +0000 |
| Subject: | Re: A better error handling approach. | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67286@lists.php.net to get a copy of this message | ||
On Fri, May 3, 2013 at 2:08 AM, Sherif Ramadan <theanomaly.is@gmail.com> 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 weren't possible before.
> If the functions are wrapped to return an array we have to update the
> documentation for thousands of functions as well as break user space for
> millions of users. Now array_map('file',$files) has a convoluted error state
> problem. This isn't as simple of a change as you're making it out to be.
> I'm sure every approach has merit. The problem here is the return on
> investment for implementing such a change in PHP. It's a lot of work for
> very little benefit.
I was speaking of user-space libraries/code. I'm not expecting all of
PHP core to change. I believe making the changes to the parser to
facilitating this approach in user-space code would be worth the
effort, and user-space libraries could normalize the error approach as
they see fit.
Adam