Re: [VOTE] Expectations
| From: | Joe Watkins | Date: | Fri, 20 Feb 2015 08:38:04 +0000 |
| Subject: | Re: [VOTE] Expectations | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83275@lists.php.net to get a copy of this message | ||
The custom exception must derive from AssertionException, so the same
optimization is possible.
Cheers
Joe
On Fri, Feb 20, 2015 at 8:28 AM, Xinchen Hui <laruence@php.net> wrote:
> Hey:
>
>
>
> On Thu, Feb 19, 2015 at 5:09 PM, Joe Watkins <pthreads@pthreads.org>
> wrote:
> > Morning internals,
> >
> > The expectations RFC is now in voting phase:
> > https://wiki.php.net/rfc/expectations#vote
>
> sorry, the thread is too long to read.. I am not sure whether there
> was some similar opinion before..
>
> I voted without custom exception, that is because.
>
> if all assertion exception is AssertException, then we can simply
> optimized them away while zend.assert is disabled..
>
> like:
>
> try {
> foo();
> bar();
> assert();
> } catch (AssertException $e) {
> //these statements can be optimized away.
> }
>
> but with custom exception..
>
> try {
>
> sqllitefunc(); // no threw
> sqllitefunc1(); //no threw
> assert("", new SqlLiteException());
> } catch (SqlliteException $e) {
> //we are not sure maybe sqllitefunc can throw SqliteException.
> // thus we can not optimized these statements ayway
> }
>
> thanks
> >
> > Cheers
> > Joe
>
>
>
> --
> Xinchen Hui
> @Laruence
> http://www.laruence.com/
>