|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-12-08 00:06 UTC] daniel dot oconnor at gmail dot com
Description: ------------ If you don't supply a detail param in the constructor of SoapFault, the property doesn't exist. See also bug #39357 Reproduce code: --------------- <?php $sf = new SoapFault(null, null, null, "Details!"); var_dump($sf); $sf = new SoapFault(null, null); var_dump($sf); Expected result: ---------------- Both objects define a detail property Actual result: -------------- object(SoapFault)#1 (8) { ["message:protected"]=> string(0) "" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(17) "C:\soap_fault.php" ["line:protected"]=> int(2) ["trace:private"]=> array(0) { } ["faultstring"]=> string(0) "" ["detail"]=> string(8) "Details!" } object(SoapFault)#2 (7) { ["message:protected"]=> string(0) "" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(17) "C:\soap_fault.php" ["line:protected"]=> int(6) ["trace:private"]=> array(0) { } ["faultstring"]=> string(0) "" } PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
Another variant: PHP 5.2.13, somehow someone is raising soapfaults without a faultcode (or it's null, or something); which is being raised by the soapclient object. try { $sc = new SoapClient(...); $sc->foo(); } catch (SoapFault $sf) { var_dump($sf->faultcode); // E_NOTICE! } This results in: Undefined property: SoapFault::$faultcode in /var/www/vx/include/classes/queue/OrderAction.php on line 19 when you try and check it. Given that the constructor requires you to provide a faultcode (http://au.php.net/soapfault); if the soapfault object doesn't set default properties, at least ensure where it's invoked by the soapclient passes in the right parameters. It's the same scenario as the original report; just a different property.