Re: RFC: Expectations
| From: | Derick Rethans | Date: | Mon, 21 Oct 2013 09:57:13 +0000 |
| Subject: | Re: RFC: Expectations | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69725@lists.php.net to get a copy of this message | ||
On Fri, 18 Oct 2013, Joe Watkins wrote:
> Evening Chaps,
>
> Following on from discussion regarding assertion API in PHP, the
> following RFC is now up for discussion:
>
> https://wiki.php.net/rfc/expectations
>
> Please do point out any missing sections or information, so that it
> can be clarified as quickly as possible.
>
> I hope this conveys the idea a bit clearer to everyone ?
This is again an RFC that does not even attempt to argue for its
usefulness. "This functionality was meant to replace the assert() API
that currently exists in PHP, because of problems replacing it in a
compatible manner". This doesn't say what is wrong with assert() or
whether we *need* expect.
Besides that, why support execptions here. asserts are for testing
things in development in order not to cock things up. Using exceptions
for this makes very little sense. All of your examples even promote to
handle exceptions and continue with excecution. If you want that, just
use normal if()s with exceptions. I don't see the point of yet another
syntax extension to do things you can already do just fine.
cheers,
Derick