|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-12-13 11:10 UTC] fabien dot papet at gmail dot com
Description:
------------
It seems like an uncacthable fatal error is thrown with an exception when an url is unreachable
Test script:
---------------
<?php
echo 'start'.PHP_EOL;
set_error_handler(function() {
echo 'error'.PHP_EOL;
}, E_ALL);
try {
$client = new SoapClient('http://thisaddressdoesnotexists', ['exceptions' => true, 'trace' => 0]);
} catch (SoapFault $exception) {
var_dump('Exception: '.$exception->getMessage());
} catch (Exception $exception) {
var_dump('Exception: '.$exception->getMessage());
}
echo 'end';
Expected result:
----------------
start
string(143) "Exception: SOAP-ERROR: Parsing WSDL: Couldn't load from 'thisaddressdoesnotexists' : failed to load external entity "thisaddressdoesnotexists"
"
end
Actual result:
--------------
start
error
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'thisaddressdoesnotexists' : failed to load external entity "thisaddressdoesnotexists"
in C:\Users\.....\soaptest.php on line 9
string(143) "Exception: SOAP-ERROR: Parsing WSDL: Couldn't load from 'thisaddressdoesnotexists' : failed to load external entity "thisaddressdoesnotexists"
"
end
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 23 13:00:01 2025 UTC |
tested in another computer with php 7.1.11 <?php echo 'start'.PHP_EOL; var_dump(extension_loaded('xdebug')); try { $client = new SoapClient('http://thisaddressdoesnotexists', ['exceptions' => true, 'trace' => 0]); } catch (SoapFault $exception) { var_dump('Exception: '.$exception->getMessage()); } catch (Exception $exception) { var_dump('Exception: '.$exception->getMessage()); } echo 'end'; php test.php start bool(false) PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://thisaddressdoesnotexists' : failed to load external entity "http://thisaddressdoesnotexists" in C:\Users\fabie\Desktop\test.php on line 7 string(157) "Exception: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://thisaddressdoesnotexists' : failed to load external entity "http://thisaddressdoesnotexists" " end