From:             
Operating system: Gentoo Linux (x86_64-3.1.7)
PHP version:      5.3.9
Package:          PHP options/info functions
Bug Type:         Bug
Bug description:error_reporting() = 0?

Description:
------------
---
>From manual page: http://www.php.net/function.set-error-handler#refsect1-
function.set-error-handler-parameters
---

In the manual, it is written:

error_reporting() settings will have no effect and your error handler will
be 
called regardless - however you are still able to read the current value of

error_reporting and act appropriately. <b>Of particular note is that this
value 
will be 0 if the statement that caused the error was prepended by the @
error-
control operator.</b>

Is there any particular reason why error_reporting() should return 0 if the

statement that caused the error was prepended by the @ error-control
operator?  
I mean, if errors are handled by a custom error handler callback set by 
set_error_handler(), there is currently no easy way to get current value of

error_reporting(), right?  Because inside error handler callback function
it may 
just return 0.  If we want to log or not log entries into a custom error
log 
within this callback function depending on the setting of error_reporting,
we're 
unable to do so in situations when '@' was used before the statement that
caused 
error?  We could of course save value of error_reporting() in the beginning
of 
our script to a global variable and use it from within the error call back

function, but why?

Thanks,

Andrejs


-- 
Edit bug report at https://bugs.php.net/bug.php?id=60954&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60954&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60954&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60954&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60954&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60954&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60954&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60954&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60954&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60954&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60954&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60954&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60954&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60954&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60954&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60954&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60954&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60954&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60954&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60954&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60954&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60954&r=mysqlcfg

Reply via email to