Re: [RFC][DISCUSSION] Error Exceptions mode
| From: | Rowan Tommins | Date: | Sun, 24 May 2020 23:28:47 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Error Exceptions mode | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110272@lists.php.net to get a copy of this message | ||
On 24/05/2020 22:07, Katie Volz wrote:
I hadn't thought putting the error types in the declare(). My only issue with that is how that would interact with the error_reporting setting - for example if I set my error_reporting to E_WARNING and error_exceptions to E_ALL I'm not sure whether a notice would be thrown.In my mind error_reporting should make absolutely no difference. As you say, this option would be for people who don't want to interact with the current error system in any way, and that includes its global configuration state. For instance, imagine you wrote this: declare(error_exceptions=E_WARNING); $fh = fopen($filePath, 'r'); // code using $fh The point of using the declare here would be to avoid checking if $fh is false, since any errors opening the file would become exceptions. If error_reporting(0) can turn off that exception, you'll have to check for false anyway, defeating the purpose. Regards, -- Rowan Tommins (né Collins) [IMSoP]