Skip to content

Commit

Permalink
php 7.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
falkenhawk committed Dec 12, 2017
1 parent 87a78fa commit ea5a622
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/Zend/XmlRpc/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,17 @@ protected static function _createSimpleXMLElement(&$xml)
*/
protected static function _extractTypeAndValue(SimpleXMLElement $xml, &$type, &$value)
{
list($type, $value) = each($xml);
// php 7.2 compatibility
// list($type, $value) = each($xml);
list($type, $value) = [key($xml), current($xml)];

if (!$type and $value === null) {
$namespaces = array('ex' => 'http://ws.apache.org/xmlrpc/namespaces/extensions');
foreach ($namespaces as $namespaceName => $namespaceUri) {
$namespaceXml = $xml->children($namespaceUri);
list($type, $value) = each($namespaceXml);
// php 7.2 compatibility
// list($type, $value) = each($namespaceXml);
list($type, $value) = [key($namespaceXml), current($namespaceXml)];
if ($type !== null) {
$type = $namespaceName . ':' . $type;
break;
Expand Down

0 comments on commit ea5a622

Please sign in to comment.