On 6/27/2016 9:53 PM, Stanislav Malyshev wrote:
> Hi!
> 
>> Currently error_get_last() always contains the last error that occurred,
>> however, this is actually not desired if the last error was an exception
>> that was caught.
>>
>> https://github.com/php/php-src/pull/1936
> 
> I think conditioning warnings on whether exception is caught or not is a
> very bad idea. However, having _either_ exception _or_ PHP error and not
> producing both (except in the case where uncaught exception becomes
> fatal error I guess) may be a good idea, but it needs careful checking
> of the implications. In general, old error mechanism and exceptions are
> not very good combination, and using them together may be troublesome.
> 
> It's definitely not "just a bug fix" - it needs careful check of what
> exactly happens when.
> 

This is exactly how I see this situation too and why I mailed the list
while asking for feedback.

I think the actual problem from the bug report is not related to the
provided patch that I updated a bit, the problem is as far as I can tell
within the DateTime::__construct method were the error mode is changed
to E_THROW but upon throwing a warning is generated as well. I had a
look at other implementations that change the mode but they did not
behave the same.

I am not familiar enough with all the code yet to simply point out what
is actually wrong but will definitely invest more time unless somebody
else who knows more does and simply fixes it.

-- 
Richard "Fleshgrinder" Fussenegger

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to