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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: requinix@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 03:01:28 2024 UTC