Re: Declare minimum PHP version required?

From: Date: Wed, 05 Feb 2014 01:30:27 +0000
Subject: Re: Declare minimum PHP version required?
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi all,
On Wed, Feb 5, 2014 at 6:43 AM, Ferenc Kovacs <[email protected]> wrote:

> > On 04/02/2014 21:04, Ferenc Kovacs wrote:
> >
> >> with the current assert implementation the assert is a function, which
> >> eval()-s the expression argument, but it will return early if asserts
> are
> >> disabled(http://lxr.php.net/xref/PHP_5_5/ext/standard/assert.c#149)
> >> with the proposed assert (https://wiki.php.net/rfc/expectations) the
> >> assert will be changed into a language construct, which has the
> advantage
> >> that we can use expressions instead of passing a string for evaluation
> >> without additional cost, also executing that is cheaper than a function
> >> call, and when the assertions are disabled they will be almost
> zero-cost.
> >>
> >>
> > Thanks for that. As posted elsewhere, I think the RFC could make that
> > clearer.
> >
> > So the relevance to this discussion is that you could already do a
> version
> > check with an assert(), and the proposed version of assert() would be as
> > efficient as the proposed declare(); does that sound right?
> >
> >
> I would wait for Yasuo to answer, but that my understanding, yes.


Yes. New assert() is as efficient as declare().
I cannot wait to use new assert()!

Regards,

P.S. I really would like to have 'callable' as the 1st parameter of new
assert().

--
Yasuo Ohgaki
[email protected]


Thread (50 messages)

« previous php.internals (#72230) next »