Bug #66503 [Com]: Fatal error in SoapClient isn't really fatal

From: Date: Wed, 13 May 2015 15:38:01 +0000
Subject: Bug #66503 [Com]: Fatal error in SoapClient isn't really fatal
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192652@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66503&edit=1 ID: 66503 Comment by: abasso at emporos dot net Reported by: gordon dot mcvey at ntlworld dot com Summary: Fatal error in SoapClient isn't really fatal Status: Open Type: Bug Package: SOAP related Operating System: Ubuntu Linux, Mac OSX Lion PHP Version: 5.4.24 Block user comment: N Private report: N New Comment: I am experiencing the same issue with PHP 5.5.16. PHP should not log a fatal error then continuing the execution. In fact, not being able to retrieve the WSDL should simply generate an exception which can be handled by the script calling the SoapClient class. Previous Comments: ------------------------------------------------------------------------ [2014-01-16 21:56:41] gordon dot mcvey at ntlworld dot com PHP 5.4.6-1ubuntu1.5 (cli) (built: Dec 12 2013 04:39:44) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans I also tested this on my home machine with similar results. PHP 5.5.5 (cli) (built: Oct 20 2013 23:15:05) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans ------------------------------------------------------------------------ [2014-01-16 21:53:23] gordon dot mcvey at ntlworld dot com Description: ------------ Dealing with the SoapClient in PHP inside a try block produces an unexpected result when a failure to connect occurs. A fatal error will be logged or displayed (depending on error_reporting, display_errors and error logging settings) but the script will continue to execute. Test script: --------------- <?php echo "start\n"; try { $test = new SoapClient ('http://www.example.com/'); } catch (Exception $e) { echo "Caught exception\n"; } echo "end\n"; Expected result: ---------------- Either ====== start Caught exception end Or ====== start PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com/' : Extra content at the end of the document in soapfail.php on line 6 Actual result: -------------- start PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com/' : Extra content at the end of the document in soapfail.php on line 6 Caught exception end ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66503&edit=1

« previous php.bugs (#192652) next »