php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66291 Problem with error_reporting
Submitted: 2013-12-13 17:46 UTC Modified: 2013-12-15 00:46 UTC
From: tmop at clix dot pt Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.5.7 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tmop at clix dot pt
New email:
PHP Version: OS:

 

 [2013-12-13 17:46 UTC] tmop at clix dot pt
Description:
------------
I'm using this config on php.ini
error_reporting = E_ALL & ~E_STRICT & ~E_DEPRECATED

I convert errors to exceptions and i have this.
set_error_handler('bobErrorHandler');

Even with deprecated disabled i get: 
Exception_Error | 17782b6ec028fc3bcc578ccdadb04b70 | E_DEPRECATED preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
in /var/www/HOTFIX_Backend_Sprint_71/library/Zend/Filter/PregReplace.php (171)

I've managed to remove the error with this:
set_error_handler('bobErrorHandler', ini_get('error_reporting'));

but when i call:
$error = error_get_last();

i still get:
array(4) {
  ["type"] => int(8192)
  ["message"] => string(80) "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"
  ["file"] => string(69) "/var/www/HOTFIX_Backend_Sprint_71/library/Zend/Filter/PregReplace.php"
  ["line"] => int(171)
}
'



Expected result:
----------------
No deprecated stuff when its disabled 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-13 18:27 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2013-12-13 18:27 UTC] requinix@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

error_reporting only affects PHP's built-in error handling routine. If you establish your own handler with set_error_handler() then you need to take into account error_reporting yourself: as the mask given to set_error_handler() or inside the handler itself.

Similarly error_reporting only affects error *reporting*. The errors will still happen regardless of the setting.
 [2013-12-14 11:57 UTC] tmop at clix dot pt
The only issue for me is that the behaviour changed from 5.4 to 5.5

Thanks for the answer.
 [2013-12-15 00:46 UTC] requinix@php.net
Regarding /e? Yes, that was deprecated in 5.5.0.

http://www.php.net/ChangeLog-5.php#5.5.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 15:01:33 2024 UTC