From: eric at wepay dot com Operating system: OS X, CentOS PHP version: 5.3.15 Package: SOAP related Bug Type: Bug Bug description:WSDL load failure generates fatal, non-catchable error
Description: ------------ If a WSDL file is unavailable when running SoapClient::__construct(), PHP indicates a fatal error to STDERR yet continues to process the script. This causes erroneous errors to end up in logs and creates a lot of misdirection around whether or not we have legitimate problems. It should continue to generate the SoapFault which contains approximately the same message, but should not indicate the fatal error. Test script: --------------- <?php set_error_handler(function($a,$b,$c,$d) { throw new ErrorException($b,0,$a,$c,$d); }, -1); try { new SoapClient('https://example.com/foo.bar'); } catch (SoapFault $e) { echo "SoapFault\n"; } catch (ErrorException $e) { echo "ErrorException\n"; } catch (Exception $e) { echo "Exception\n"; } echo "I survived\n"; register_shutdown_function(function() { echo 'Shutdown'; }); Expected result: ---------------- STDERR: (nothing) STDOUT: SoapFault I survived Shutdown Actual result: -------------- STDERR: PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://example.com/foo.bar' : failed to load external entity "https://example.com/foo.bar" in /private/var/folders/w2/rlynjnwx7zdfzgr2m_h6bt8m0000gn/T/untitled_4d..php on line 4 STDOUT: SoapFault I survived Shutdown -- Edit bug report at https://bugs.php.net/bug.php?id=62811&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62811&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62811&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62811&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62811&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62811&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62811&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62811&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62811&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62811&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62811&r=support Expected behavior: https://bugs.php.net/fix.php?id=62811&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62811&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62811&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62811&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62811&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62811&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62811&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62811&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62811&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62811&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62811&r=mysqlcfg