On Sep 05 14:19:16, Kalle Sommer Nielsen wrote:
> Hi
> 
> Is there any reason for we don't support expressions like:
> 
> test() or throw new Exception('test() failed');
> 
> 
> If no, is there any argument against supporting such a syntax in trunk?

Technically, it should be quite easy to have that available, but it
might become tricky to handle cases like: foo(throw exception()); or
even "throw throw throw new Foo;" ? :)

Also, I consider "or die" patterns to be a bad idea, extending it for
exceptions might make it a tad bit better, but I still find that bad
because of i.e. non trivial precedence rules:

include("foo") or throw new Exception("ads");

it will neither include "foo" nor throw any exception.

> 
> -- 
> regards,
> 
> Kalle Sommer Nielsen
> ka...@php.net
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
Etienne Kneuss
http://www.colder.ch

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to