|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-27 08:35 UTC] niek at signet dot nl
[2009-11-27 13:45 UTC] niek at signet dot nl
[2010-06-20 21:27 UTC] felipe@php.net
-Status: Open
+Status: Feedback
[2010-06-20 21:27 UTC] felipe@php.net
[2010-11-04 07:55 UTC] timothee dot groleau at mig33global dot com
[2010-11-04 08:08 UTC] timothee dot groleau at mig33global dot com
[2012-06-13 12:42 UTC] jboffel at gmail dot com
[2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 04:00:02 2025 UTC |
Description: ------------ The Feature SOAP_SINGLE_ELEMENT_ARRAYS has no effect when I try to get a resultset that sometimes contains only one Object. It always removes the array and returns the Object without the array. See Example Code for additional information and feel free to contact me for additional information. Reproduce code: --------------- <?php $options = array( 'location' => 'http://u8020.intx.ch.netstream.com/dnssoap/soap.cgi' , 'uri' => 'http://dnstool.netstream.com/DnsAPI' , 'exceptions' => false , 'trace' => false , 'soap_version' => SOAP_1_1 , 'user_agent' => 'PHP DNS Client' , 'features' => SOAP_SINGLE_ELEMENT_ARRAYS ); $soapserver = new SoapClient(null, $options); //Watch Param type = A here --> array 2 results expected here $result = $soapserver->__soapCall('GetResourceRecords', array(new SoapParam('wtf.com', 'zone') , new SoapParam('A', 'type') )); var_dump($result); //Watch Param type = MX here --> array with 1 result expected here $result = $soapserver->__soapCall('GetResourceRecords', array(new SoapParam('wtf.com', 'zone') , new SoapParam('MX', 'type') )); var_dump($result); ?> Expected result: ---------------- array(2) { ["total"]=> string(1) "2" ["records"]=> array(2) { [0]=> object(stdClass)#4 (7) { ["name"]=> string(4) "test" ["class"]=> string(2) "IN" ["data"]=> string(9) "127.0.0.1" ["id"]=> string(6) "160441" ["parameter"]=> string(0) "" ["ttl"]=> string(0) "" ["type"]=> string(1) "A" } [1]=> object(stdClass)#5 (7) { ["name"]=> string(4) "test" ["class"]=> string(2) "IN" ["data"]=> string(9) "127.0.0.1" ["id"]=> string(6) "160442" ["parameter"]=> string(0) "" ["ttl"]=> string(0) "" ["type"]=> string(1) "A" } } } array(2) { ["total"]=> string(1) "2" ["records"]=> array(1) { [0]=> object(stdClass)#4 (7) { ["name"]=> string(4) "stop.bugging.me" ["class"]=> string(2) "IN" ["data"]=> string(9) "32" ["id"]=> string(6) "160443" ["parameter"]=> string(0) "50" ["ttl"]=> string(0) "1337" ["type"]=> string(1) "MX" } } } Actual result: -------------- array(2) { ["total"]=> string(1) "2" ["records"]=> array(2) { [0]=> object(stdClass)#4 (7) { ["name"]=> string(4) "test" ["class"]=> string(2) "IN" ["data"]=> string(9) "127.0.0.1" ["id"]=> string(6) "160441" ["parameter"]=> string(0) "" ["ttl"]=> string(0) "" ["type"]=> string(1) "A" } [1]=> object(stdClass)#5 (7) { ["name"]=> string(4) "test" ["class"]=> string(2) "IN" ["data"]=> string(9) "127.0.0.1" ["id"]=> string(6) "160442" ["parameter"]=> string(0) "" ["ttl"]=> string(0) "" ["type"]=> string(1) "A" } } } array(2) { ["total"]=> string(1) "1" ["records"]=> object(stdClass)#6 (7) { ["name"]=> string(15) "stop.bugging.me" ["class"]=> string(2) "IN" ["data"]=> string(2) "32" ["id"]=> string(6) "160443" ["parameter"]=> string(2) "50" ["ttl"]=> string(4) "1337" ["type"]=> string(2) "MX" } }