On 22 October 2013 10:32, Joe Watkins <pthre...@pthreads.org> wrote:
> On 10/22/2013 06:20 PM, Adam Harvey wrote:
>> I agree that something to replace the eval-based assert() would be
>> good. What if the new syntax simply respected assert_options(), and
>> assert_options() was extended to support an explicit ASSERT_EXCEPTION
>> control option (that presumably took an exception class name as its
>> option value)? That seems like it would provide the exception based
>> possibilities that some posters want while maintaining the same
>> assertion behaviour that users are already used to by default.
>
> I'm a bit perplexed at the need to retain any compatibility with what is a
> poor implementation ?

To be fair, I think part of the disconnect here is that I don't feel
like the current implementation is particularly poor besides the
eval-based API. I don't really want an assertion failure to throw an
exception — if I did, I'd use an assert callback or ErrorException to
do that. I want it logged so I can look at it later, and that's easily
configured with the current assertion setup.

I guess I'm wondering if there's a middle ground here, rather than
throwing the assertion baby out with the bathwater in favour of an
entirely new thing that could simply be syntax sugar sprinkled over an
existing, working implementation.

Adam

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to