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]

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

Reply via email to