Fix #2737
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php
index ab907e7..d0f6d83 100644
--- a/system/libraries/Xmlrpc.php
+++ b/system/libraries/Xmlrpc.php
@@ -1121,15 +1121,15 @@
 		//-------------------------------------
 
 		$parser = xml_parser_create($this->xmlrpc_defencoding);
-
-		$this->xh[$parser] = array(
-						'isf'		=> 0,
-						'ac'		=> '',
-						'headers'	=> array(),
-						'stack'		=> array(),
-						'valuestack'	=> array(),
-						'isf_reason'	=> 0
-					);
+		$pname = (string) $parser;
+		$this->xh[$pname] = array(
+			'isf'		=> 0,
+			'ac'		=> '',
+			'headers'	=> array(),
+			'stack'		=> array(),
+			'valuestack'	=> array(),
+			'isf_reason'	=> 0
+		);
 
 		xml_set_object($parser, $this);
 		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE);
@@ -1145,7 +1145,7 @@
 			{
 				break;
 			}
-			$this->xh[$parser]['headers'][] = $line;
+			$this->xh[$pname]['headers'][] = $line;
 		}
 		$data = implode("\r\n", $lines);
 
@@ -1163,18 +1163,18 @@
 		xml_parser_free($parser);
 
 		// Got ourselves some badness, it seems
-		if ($this->xh[$parser]['isf'] > 1)
+		if ($this->xh[$pname]['isf'] > 1)
 		{
 			if ($this->debug === TRUE)
 			{
-				echo "---Invalid Return---\n".$this->xh[$parser]['isf_reason']."---Invalid Return---\n\n";
+				echo "---Invalid Return---\n".$this->xh[$pname]['isf_reason']."---Invalid Return---\n\n";
 			}
 
-			return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
+			return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return'].' '.$this->xh[$pname]['isf_reason']);
 		}
-		elseif ( ! is_object($this->xh[$parser]['value']))
+		elseif ( ! is_object($this->xh[$pname]['value']))
 		{
-			return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
+			return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return'].' '.$this->xh[$pname]['isf_reason']);
 		}
 
 		// Display XML content for debugging
@@ -1182,10 +1182,10 @@
 		{
 			echo '<pre>';
 
-			if (count($this->xh[$parser]['headers'] > 0))
+			if (count($this->xh[$pname]['headers'] > 0))
 			{
 				echo "---HEADERS---\n";
-				foreach ($this->xh[$parser]['headers'] as $header)
+				foreach ($this->xh[$pname]['headers'] as $header)
 				{
 					echo $header."\n";
 				}
@@ -1193,13 +1193,13 @@
 			}
 
 			echo "---DATA---\n".htmlspecialchars($data)."\n---END DATA---\n\n---PARSED---\n";
-			var_dump($this->xh[$parser]['value']);
+			var_dump($this->xh[$pname]['value']);
 			echo "\n---END PARSED---</pre>";
 		}
 
 		// Send response
-		$v = $this->xh[$parser]['value'];
-		if ($this->xh[$parser]['isf'])
+		$v = $this->xh[$pname]['value'];
+		if ($this->xh[$pname]['isf'])
 		{
 			$errno_v = $v->me['struct']['faultCode'];
 			$errstr_v = $v->me['struct']['faultString'];
@@ -1218,7 +1218,7 @@
 			$r = new XML_RPC_Response($v);
 		}
 
-		$r->headers = $this->xh[$parser]['headers'];
+		$r->headers = $this->xh[$pname]['headers'];
 		return $r;
 	}
 
@@ -1249,6 +1249,8 @@
 	 */
 	public function open_tag($the_parser, $name)
 	{
+		$the_parser = (string) $the_parser;
+
 		// If invalid nesting, then return
 		if ($this->xh[$the_parser]['isf'] > 1) return;
 
@@ -1348,6 +1350,8 @@
 	 */
 	public function closing_tag($the_parser, $name)
 	{
+		$the_parser = (string) $the_parser;
+
 		if ($this->xh[$the_parser]['isf'] > 1) return;
 
 		// Remove current element from stack and set variable
@@ -1480,6 +1484,8 @@
 	 */
 	public function character_data($the_parser, $data)
 	{
+		$the_parser = (string) $the_parser;
+
 		if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already
 
 		// If a value has not been found