|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43338 SoapEnc Arrays and Single Element Arrays
Submitted: 2007-11-19 17:50 UTC Modified: 2021-03-25 11:19 UTC
Avg. Score:4.5 ± 0.7
Reproduced:20 of 20 (100.0%)
Same Version:14 (70.0%)
Same OS:9 (45.0%)
From: daniel dot seif at castex dot de Assigned:
Status: Open Package: SOAP related
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: daniel dot seif at castex dot de
New email:
PHP Version: OS:


 [2007-11-19 17:50 UTC] daniel dot seif at castex dot de
If a SoapServer-Object is instantiated with the option SOAP_SINGLE_ELEMENT_ARRAYS (to automatically get an array if defined in the wsdl) together with SOAP_USE_XSI_ARRAY_TYPE (to allow array types instead of wsdl types), an request sent with an SOAPEnc:Array will be transformed to an array with a "deepness" of 2.

Reproduce code:
class SoapHandler {
	function getSomething($arguments) {

 * SoapServer

$server = new SoapServer($wsdl,
		'uri' => $uri,

 * request

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="">
			<arguments xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]">
				<item xsi:type="xsd:string">String 1</item>
				<item xsi:type="xsd:string">String 2</item>

Expected result:
    [0] => String 1
    [1] => String 2

Actual result:
    [0] => Array
            [0] => String 1
            [1] => String 2



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-25 10:34 UTC] daniel dot seif at castex dot de
It's still not working in 5.2.10-dev as of today. I tested it with the windows binary build from yesterday.

I provided you a test-package, you can download it here:
 [2010-07-22 02:47 UTC] daniel dot seif at castex dot de
Checked again against PHP 5.3.2, the issue is still unsolved.

I created two php tests for this. One for wsdl-mode on (works as expected) and one for wsdl-mode off (erroneous as described here)

You can download them here:

Please do me a favor and take care of this issue. If I had enough knowledge, I'd try to submit a patch, but obviously I don't ...
 [2010-07-22 03:01 UTC] daniel dot seif at castex dot de
-PHP Version: 5.2CVS-2009-04-25 +PHP Version: 5.*
 [2010-07-22 03:01 UTC] daniel dot seif at castex dot de
Since the problem exists in the 5.2 as well as in the 5.3 branch, I changed the affected PHP Version
 [2012-06-13 06:49 UTC] daniel dot seif at castex dot de
Not sure, if this is the right way to let this issue pop up, but the problem is still not solved. 

Will this be fixed any time soon?
 [2021-03-25 11:19 UTC]
-Type: Bug +Type: Documentation Problem
 [2021-03-25 11:19 UTC]
I can confirm the reported behavior with PHP-7.4.  And while I
agree that this doesn't look right, I'm afraid that changing this
long standing behavior might cause more harm than good.  Maybe the
best course of action is to document that.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 21:05:50 2023 UTC