Re: Declare minimum PHP version required?

From: Date: Tue, 04 Feb 2014 21:43:40 +0000
Subject: Re: Declare minimum PHP version required?
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-72218@lists.php.net to get a copy of this message
On Tue, Feb 4, 2014 at 10:28 PM, Rowan Collins <rowan.collins@gmail.com>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. -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#72218) next »