Bug #67641 [Opn->Nab]: SoapFault Traversable ?
| From: | requinix@php.net | Date: | Thu, 17 Jul 2014 19:29:37 +0000 |
| Subject: | Bug #67641 [Opn->Nab]: SoapFault Traversable ? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186708@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67641&edit=1
ID: 67641
Updated by: requinix@php.net
Reported by: vosa at binaryparadise dot com
Summary: SoapFault Traversable ?
-Status: Open
+Status: Not a bug
Type: Bug
Package: SOAP related
Operating System: debian
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Objects that are not Traversable can still be iterated over using a default behavior: the set of
accessible properties and their values.
http://php.net/manual/en/language.oop5.iterations.php
As mentioned in a few places, SoapFault has undocumented properties "faultstring" and
"faultcode". Adding that to the default foreach behavior results in the output you see.
Previous Comments:
------------------------------------------------------------------------
[2014-07-17 11:50:12] vosa at binaryparadise dot com
Description:
------------
---
From manual page: http://www.php.net/class.soapfault
---
There's strange behavior of SoapFault instance when used in foreach construct. It behave almost
like Transversable object, but it shouldn't. SoapFault extends Exception and none of these
classes implements Transversable interface...
Test script:
---------------
print "Exception:\n";
foreach(new Exception('message') as $k => $v)
print "$k: $v\n";
print "SoapFault:\n";
foreach(new Soapfault('faultcode', 'faultstring') as $k => $v)
print "$k: $v\n";
Expected result:
----------------
Exception:
SoapFault:
Actual result:
--------------
Exception:
SoapFault:
faultstring: faultstring
faultcode: faultcode
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67641&edit=1