Re: RFC karma
| From: | Joost Koehoorn | Date: | Mon, 24 Jun 2013 13:23:15 +0000 |
| Subject: | Re: RFC karma | ||
| References: | 1 2 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-16067@lists.php.net to get a copy of this message | ||
For instance, a library may throw an exception if some condition is not met, and you just try to
call the method to see if it works, because you may not know the exact conditions (and these
conditions may change). By allowing for an anonymous catch block there, you indicate that you really
don't need to know anything about the exception, just that you'd like to recover from it.
Phil's request was a little different, he asked for making the variable optional. I added
support for both, but surely it can be decided that only the unnamed-catch is implemented.
Both options are possible in C#.
On 24 juni 2013 at 14:58:33, Sherif Ramadan (theanomaly.is@gmail.com) wrote:
On Sun, Jun 23, 2013 at 2:24 PM, Joost Koehoorn <joost.koehoorn@gmail.com> wrote:
Hi,
Let me first tell a little about myself. I'm 21 y/o and from the Netherlands, currently
studying Computing Science at University of Groningen. I've been using PHP for about 8 years
and now like to get my hands dirty in PHP's core.
Recently, Phil Sturgeon asked on twitter if someone would be able to add support for a certain
language construct to PHP, see https://twitter..com/philsturgeon/status/347822429877436416.
This sounded like a great opportunity to dive into the PHP core, as it's not that hard to
implement. In the meantime I've successfully been able to get this working, including support
for anonymous catch-statements:
try { throw new Exception; }
catch { die('Oops!'); }
Just out of curiosity, what is the use case for anonymous catch blocks? I've honestly never had
a reason to do this before.
That's why I'd like to create an official RFC where details about the exact possibilities
may be discussed.
My wiki username is 'joostk'.
Regards,
Joost
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php