Hi Andrea,
On Wed, Feb 5, 2014 at 6:12 AM, Andrea Faulds <[email protected]> wrote:
> On 04/02/14 21:09, Yasuo Ohgaki wrote:
>
>> It's inconsistent as closure is valid expression.
>> Allowing callable make behavior consistent. It enables more
>> complex assertion inline, thus it's possible name space clean.
>>
>
> Might also help assert() performance, given that I expect executing a
> closure to be quicker than eval() (though I may be wrong).
eval() works.
php > assert(eval('FALSE;'));
Warning: assert(): Assertion failed in php shell code on line 1
php > assert(eval('return FALSE;'));
Warning: assert(): Assertion failed in php shell code on line 1
php >
However, it does not solve inconsistency. PHP code has to be string.
Writing PHP code as string is not fun thing to do ;)
Regards,
--
Yasuo Ohgaki
[email protected]