Re: Design by Contract
| From: | Stanislav Malyshev | Date: | Wed, 11 Feb 2015 08:09:57 +0000 |
| Subject: | Re: Design by Contract | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82449@lists.php.net to get a copy of this message | ||
Hi!
>> function foo($a)
>> require($a >= 0)
>> {
>> }
>
> This is a step better but still we have the similar issues with
> readability, to which reuse of 'require' is added.
Just a thought - what about something like __pre/__post? We own __*, so
no BC problems.
OTOH, don't our new parsing improvements allow us to handle syntax like
this without introducing a keyword that would be forbidden as
class/function name? The context is pretty unambiguous here.
--
Stas Malyshev
smalyshev@gmail.com