[PHP-BUG] Bug #65705 [NEW]: simplexml_load_string does not honor error_reporting settting

2013-09-19 Thread oskar dot mothander at gmail dot com
From: oskar dot mothander at gmail dot com
Operating system: Windows 7 (64)
PHP version:  5.4.19
Package:  SimpleXML related
Bug Type: Bug
Bug description:simplexml_load_string does not honor error_reporting settting

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('');
// 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]:  on
line 2

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ on
line 2

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



Bug #65705 [Fbk->Csd]: simplexml_load_string does not honor error_reporting settting

2013-09-24 Thread oskar dot mothander at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65705&edit=1

 ID: 65705
 User updated by:oskar dot mothander at gmail dot com
 Reported by:oskar dot mothander at gmail dot com
 Summary:simplexml_load_string does not honor error_reporting
 settting
-Status: Feedback
+Status: Closed
 Type:   Bug
 Package:SimpleXML related
 Operating System:   Windows 7 (64)
 PHP Version:5.4.19
 Block user comment: N
 Private report: N

 New Comment:

My misstake I think


Previous Comments:

[2013-09-22 22:47:33] ahar...@php.net

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)?


[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('');
// 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]:  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