Re: RFC: Expectations
| From: | Dmitry Stogov | Date: | Mon, 16 Feb 2015 15:47:34 +0000 |
| Subject: | Re: RFC: Expectations | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82856@lists.php.net to get a copy of this message | ||
Hi Nikita,
it looks like a part of old implementation is not trivial with new AST
compiler.
previously we translated assert(condition) into assert(condition,
"assert(condition)").
actually we just captured a part of input buffer and added missing string
argument.
Is there a simple way to do the same now?
It's possible to convert AST into string using recursive pretty-printer.
It's not a simple task itself, but it may be reused for other things.
Joe, the rest (including zero-cost assert) is implemented at
https://github.com/php/php-src/pull/1088/files
9 related tests are failed for now.
Thanks. Dmitry.
On Mon, Feb 16, 2015 at 1:32 PM, Joe Watkins <pthreads@pthreads.org> wrote:
> > is there any penalty of catch-AssertionException-blocks? Are those
> eliminated in production code?
>
> Assertions should never be enabled in production code, the ability to catch
> (and enable by configuration) the exception serves the developer of the
> code during development only.
>
> The example code is bad, I'll clear this up.
>
> Cheers
> Joe
>
> On Mon, Feb 16, 2015 at 10:11 AM, Crypto Compress <
> cryptocompress@googlemail.com> wrote:
>
> > Hi Joe,
> >
> > is there any penalty of catch-AssertionException-blocks? Are those
> > eliminated in production code?
> >
> > Thanks
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>