Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you using xdebug? According to <a href="http://bugs.php.net/bug.php?id=34657" rel="noreferrer">this PHP bug report and discussion</a>, the issue has been fixed at least since PHP 5.1, but <a href="http://bugs.xdebug.org/view.php?id=249" rel="noreferrer">this xdebug bug</a> messes with 'fatal error to exception conversions' in a way that the exception is not generated and the fatal error 'leaks through'.</p> <p>I can reproduce this locally, with xdebug enabled:</p> <pre><code>try { $soapClient = new SoapClient('http://www.example.com'); } catch(Exception $e) { $exceptionMessage = t($e-&gt;getMessage()); print_r($exceptionMessage); } </code></pre> <p>This gives me the fatal error you described, without even entering the catch clause:</p> <pre><code>Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com' </code></pre> <p><strong>It works if I disable xdebug</strong> right before the call:</p> <pre><code>xdebug_disable(); try { $soapClient = new SoapClient('http://www.example.com'); } catch(Exception $e) { $exceptionMessage = t($e-&gt;getMessage()); print_r($exceptionMessage); } </code></pre> <p>This triggers the exception as expected, and I get a proper SoapFault Object in the catch clause with a message of:</p> <pre><code>SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com' </code></pre> <p>So basically exceptions work as advertised. If they don't work in your case, you might encounter the xdebug bug, or maybe a similar issue with another 3rd party component.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload