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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
49 - 24 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 14:01:30 2024 UTC