Bug #79191 [Com]: Error in SoapClient creation leads to DOMDocument::save() not working
| From: | sebastian@php.net | Date: | Wed, 29 Jan 2020 14:13:19 +0000 |
| Subject: | Bug #79191 [Com]: Error in SoapClient creation leads to DOMDocument::save() not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225220@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79191&edit=1
ID: 79191
Comment by: sebastian@php.net
Reported by: sebastian@php.net
Summary: Error in SoapClient creation leads to
DOMDocument::save() not working
Status: Open
Type: Bug
Package: DOM XML related
Operating System: Irrelevant
PHP Version: 7.4.2
Block user comment: N
Private report: N
New Comment:
Please note that DOMDocument::saveXml() works, so the document is correctly stored in the
DOMDocument object. It is "just" that DOMDocument::save() no longer works after an error
in SoapClient occurred.
Previous Comments:
------------------------------------------------------------------------
[2020-01-29 13:57:55] sebastian@php.net
Description:
------------
When the creation of a SoapClient object fails then DOMDocument::save() no longer works. This issue
came up in the context of PHPUnit:
* https://github.com/sebastianbergmann/php-code-coverage/issues/692
* https://github.com/sebastianbergmann/php-code-coverage/pull/721
* https://github.com/sebastianbergmann/php-code-coverage/issues/692#issuecomment-579761041
A minimal and self-contained script that reproduces the issue is provided below.
Test script:
---------------
<?php
try {
new \SoapClient('does-not-exist.wsdl');
} catch (Throwable $t) {
}
$dom = new DOMDocument;
$dom->loadxml('<?xml version="1.0" ?><root />');
var_dump($dom->save('/tmp/test.xml'));
Expected result:
----------------
int(number of bytes written)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79191&edit=1