Re: RFC: Expectations

From: Date: Tue, 22 Oct 2013 07:23:47 +0000
Subject: Re: RFC: Expectations
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 10/21/2013 09:42 PM, Andrea Faulds wrote:
On 21/10/2013 21:36, [email protected] wrote:
This proposal sounds a lot like exceptions to me or am I missing something :/ Could we do something like throw new expectation($expects, $message);
Er, T_EXPECT will be essentially a clone of Java and Python's assert statement, but not called assert because of the existing assert() function (and backwards-compatibility is PHP's middle name). Unless you mean the similar name. Well, I don't think "exception" and "expect" can be confused (though as someone who used to use Python, I keep reading this as "except", Python's equivalent to "catch"), though "ExpectationException" might be confusing. I think we should name it "AssertionException".
I think it would be more confusing for expect to throw an AssertionException. Cheers Joe

Thread (51 messages)

« previous php.internals (#69741) next »