Edit report at https://bugs.php.net/bug.php?id=65705&edit=1
ID: 65705 Updated by: ahar...@php.net Reported by: oskar dot mothander at gmail dot com Summary: simplexml_load_string does not honor error_reporting settting -Status: Open +Status: Feedback Type: Bug Package: SimpleXML related Operating System: Windows 7 (64) PHP Version: 5.4.19 Block user comment: N Private report: N New Comment: I can't reproduce this: setting display_errors to false or removing E_WARNING from error_reporting() quiets the warnings as expected for me. Do you have any extensions loaded that may interfere with error reporting, such as xdebug or scream? (You can check this via phpinfo().) If not, does this still occur on a current version of PHP (ie 5.4.20 or 5.5.4)? Previous Comments: ------------------------------------------------------------------------ [2013-09-19 08:34:46] oskar dot mothander at gmail dot com Description: ------------ Calling simplexml_load_string() on invalid xml will output Warnings even though you've been a good developer and turned these OFF on live environment. Using "libxml_use_internal_errors(true);" fixes the problem but shouldn't be nessesary. This caused my site to display Warnings live. Affected versions: PHP 5.4.3 (not in the list above?) PHP 5.3.8 (VC9 X86 32bit thread safe) + PEAR Test script: --------------- ini_set("display_errors", false); simplexml_load_string('<apa>'); // Will still output Warnings even though they are off. Expected result: ---------------- Empty result Actual result: -------------- Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Premature end of data in tag apa line 1 on line 2 Warning: simplexml_load_string() [function.simplexml-load-string]: <apa> on line 2 Warning: simplexml_load_string() [function.simplexml-load-string]: ^ on line 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65705&edit=1