Re: [PHP-DEV] 回复: [PHP-DEV] Make try/catch brackets optinal

2012-07-20 Thread Andrew Faulds
I don't think we should add it purely for consistency, because then we'd have to allow nonsense like: switch x; case 1; endcase; endswitch; or... try; x; catch e; endtry; Sure, consistency is good, but this would allow sloppy code. On Jul 20, 2012 8:36 AM, "Amaury Bouchard" wrote: > 2012/7/19

Re: [PHP-DEV] 回复: [PHP-DEV] Make try/catch brackets optinal

2012-07-20 Thread Amaury Bouchard
2012/7/19 Reeze > 在 2012年7月19日星期四,下午6:45,Rune Kaagaard 写道: > > > +1 for the consistency of it. It's surprising that: > > > > if ($foo) > > return $bar; > > else > > return 42; > > > > works and: > > > > try > > maybe_dangerous(); > > catch(Dynamite $e) > > handle_error(); > > > > > > Ther

[PHP-DEV] 回复: [PHP-DEV] Make try/catch brackets optinal

2012-07-19 Thread Reeze
Hi, 在 2012年7月19日星期四,下午6:45,Rune Kaagaard 写道: > +1 for the consistency of it. It's surprising that: > > if ($foo) > return $bar; > else > return 42; > > works and: > > try > maybe_dangerous(); > catch(Dynamite $e) > handle_error(); > > There is no condition after `try`, it's really har