|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63474 Fatal errors may be thrown when turning off exceptions
Submitted: 2012-11-09 19:06 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: dean at deansas dot org Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.18 OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: dean at deansas dot org
New email:
PHP Version: OS:


 [2012-11-09 19:06 UTC] dean at deansas dot org
When disabling exceptions in the constructor to SoapClient, I did not expect that 
for some errors it would trigger warnings and fatal errors. I did expect that it 
would return SoapFault objects instead, as documented on

In the event that this is expected behaviour then the documentation should make 
this clear.

Test script:
// URL requiring http auth and passing incorrect username & password
$foo = new SoapClient("",
    array( 'login' => 'bar', 'password' => 'baz', 'exceptions' => false));
print $foo;

Expected result:
That $foo is a SoapFault object, no warnings/errors are thrown and something like 
the below is output:

[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '' 
: failed to load external entity ""
 in test.php:4
Stack trace:
#0 test.php(4): SoapClient->SoapClient('http://example....', Array)
#1 {main}

Actual result:
Warning: SoapClient::SoapClient( failed to open 
stream: HTTP request failed! HTTP/1.1 401 Authorization Required
 in test.php on line 4

Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity 
"" in test.php on line 4

Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 
'' : failed to load external entity 
 in test.php on line 4


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-30 09:14 UTC] dmeziere at free dot fr
$foo won't be a SoapFault object. SoapFault is an excepion. And an exception is thrown, not instanciated.
 [2012-11-30 10:40 UTC] dean at deansas dot org
@dmeziere The page says,

"This function is useful to check if the SOAP call failed, but without using 
exceptions. To use it, create a SoapClient object with the exceptions option set 
to zero or FALSE. In this case, the SOAP method will return a special SoapFault 

Is the documentation incorrect or has one of us misunderstood something?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 06:01:32 2024 UTC