Re: RE: RFC: expectations/assertions

From: Date: Tue, 04 Feb 2014 21:09:54 +0000
Subject: Re: RE: RFC: expectations/assertions
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Sebastian,

On Tue, Feb 4, 2014 at 10:11 PM, Sebastian Krebs <[email protected]>wrote:

> but it seem not closure like this
>>
>> php > assert(function() {return 2>1;});
>> php > assert(function() {return 2<1;});
>>
>
> assert('2>1');
>
> works
>

It's not the point. Function call works, but not closure does not.

php > function f() {return FALSE;}
php > assert(f());

Warning: assert(): Assertion failed in php shell code on line 1

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.

Regards,

--
Yasuo Ohgaki
[email protected]


Thread (44 messages)

« previous php.internals (#72212) next »