Remove usage of each() for php 7.2 compat
[plcapi.git] / lib / xmlrpc.inc
index 8f85073..10cb434 100644 (file)
@@ -3122,8 +3122,8 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                        // add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals...\r
                        //if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval')))\r
                        //{\r
-                               reset($this->me);\r
-                               list($typ, $val) = each($this->me);\r
+                               $val = reset($this->me);\r
+                               $typ = key($this->me);\r
                                return '<value>' . $this->serializedata($typ, $val, $charset_encoding) . "</value>\n";\r
                        //}\r
                }\r
@@ -3134,9 +3134,8 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                        // add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals...\r
                        //if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval')))\r
                        //{\r
-                               $ar=$o->me;\r
-                               reset($ar);\r
-                               list($typ, $val) = each($ar);\r
+                               $val = reset($o->me);\r
+                               $typ = key($o->me);\r
                                return '<value>' . $this->serializedata($typ, $val) . "</value>\n";\r
                        //}\r
                }\r