safe icon indicating copy to clipboard operation
safe copied to clipboard

Replace `error_get_last()` with a custom error handler

Open j3j5 opened this issue 2 years ago • 2 comments

Try to fix #332

This is my first serious attempt at a PR on here, so please, any suggestion is welcome.

While doing this I realized the implementation for the exception handling on the curl module was wrong. With PHP8 the $ch parameter doesn't exist anymore and it's now $handle. I fixed that and added the case for the other two new handles $multi_handle and $share_handle.

I've also started using the new function (PHP 8.0+) preg_last_error_msg() to determine the error message on PcreException.

PHPStan throws no errors on my machine but I didn't have time to test it properly, so more eyes are welcome before merging.

j3j5 avatar Mar 18 '22 21:03 j3j5

I am sorry, I didn't have the time to review your PR, i will check it this week.

I also pinged @moufmouf who is much more expert in error_handlers

Kharhamel avatar Mar 28 '22 09:03 Kharhamel

I've rebased the branch and fixed the test. I'm updating the original description to mention the new PCRE Exception.

j3j5 avatar Mar 30 '22 18:03 j3j5