> -----Original Message-----
> From: Stanislav Malyshev [mailto:smalys...@gmail.com]
> Sent: Tuesday, April 19, 2016 8:11 AM
> To: Larry Garfield <la...@garfieldtech.com>; internals@lists.php.net
> Subject: Re: [PHP-DEV] [VOTE] Catching Multiple Exception Types
> 
> 
> > I do agree with the sentiment that having Foo|Bar for catch but not
> > for function signatures is going to confuse people.
> 
> Confuse which people? Do people now are confused that you can write
> multiple catch clauses for same exception but can't write multiple function
> bodies for same parameter set? Are they confused by the fact that it's a fatal
> error to pass wrong type to a function but catch just silently ignores it? Are
> they confused that you can write function(string $a) but you can't 
> catch(string
> $a)? I don't think so. I think people are pretty good at figuring out 
> exceptions
> and function parameters are different things. Java has multiple catch and no
> expression types, and .net has the same after a fashion (with somewhat weird
> syntax) but programmers on neither wonder around confused expecting to
> find type calculus somewhere.


I agree.  But I think that if people are going to be confused and will pressure 
for consistency with functions, it's an exceptionally easy (again, no pun 
intended) to explain why they are in fact inherently different and why it makes 
sense here and doesn't make sense there.

Zeev

Reply via email to