php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67648 SoapFault has undocumented properties
Submitted: 2014-07-18 09:16 UTC Modified: -
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: requinix@php.net Assigned:
Status: Open Package: SOAP related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-07-18 09:16 UTC] requinix@php.net
Description:
------------
SoapFault may set properties on itself according to values passed in through the constructor. These values are not documented and not part of the class "definition", and when set are publicly accessible.

At the very least the documentation should be updated to reflect the six potential properties.

A step beyond that would be to consider adding getter methods, like Exception classes typically have. The properties could then be kept private, though that would be a bit of a BC break (even if it was undocumented).

See also
- bug #55567 SoapFault is missing methods to get the Fault Code
- bug #67641 SoapFault Traversable ? [has a couple relevant comments]

Test script:
---------------
(copied from http://php.net/manual/en/class.soapfault.php#97875)

<?php
try {
    throw new SoapFault('code', 'string', 'actor', 'detail', 'name', 'header');
} catch (Exception $ex) {
    var_dump($ex->faultcode, $ex->faultstring, $ex->faultactor, $ex->detail, $ex->_name, $ex->headerfault);
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Aug 23 09:01:27 2019 UTC