Re: Design by Contract
| From: | Yasuo Ohgaki | Date: | Mon, 09 Feb 2015 10:41:50 +0000 |
| Subject: | Re: Design by Contract | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82260@lists.php.net to get a copy of this message | ||
HI Dmitry,
On Mon, Feb 9, 2015 at 7:34 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>
> [Without block]
> function foo() {
> require(assert-expr, 'msg');
> require(assert-expr, 'msg');
> require(assert-expr, 'msg');
> invariant(assert-expr, 'msg');
> invariant(assert-expr, 'msg');
> invariant(assert-expr, 'msg');
> return(assert-expr, 'msg');
> return(assert-expr, 'msg');
> return(assert-expr, 'msg');
>
> // function body
> }
>
OOPS. Without block cannot work ;)
I should have notice while I'm writing.
I'll go with "with block". If you find any other issues, please let me know.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net