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?
--
Rowan Collins
[IMSoP]