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?
--
regards,
Kalle Sommer Nielsen
kalle@php.net
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
kalle@php.net--
--
Etienne Kneuss
http://www.colder.ch