Re: Design by Contract
| From: | Patrick Schaaf | Date: | Thu, 05 Feb 2015 11:38:17 +0000 |
| Subject: | Re: Design by Contract | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81900@lists.php.net to get a copy of this message | ||
Am 05.02.2015 12:14 schrieb "Dmitry Stogov" <dmitry@zend.com>:
>
> For php it may look like the following:
>
> function foo()
> require(<input-assert-expression>)
> ensure(<output-assert-expression>)
> {
> ...
> }
>
> It would require only one new reserved word "ensure".
How would one access the function return value in the
output-assert-expression?
And what about side effects in these expressions? Could they be suppressed
/ made into errors somehow?
best regards
Patrick