class Value implements \Countable, \IteratorAggregate, \ArrayAccess
{
public static $xmlrpcI4 = "i4";
+ public static $xmlrpcI8 = "i8";
public static $xmlrpcInt = "int";
public static $xmlrpcBoolean = "boolean";
public static $xmlrpcDouble = "double";
public static $xmlrpcTypes = array(
"i4" => 1,
+ "i8" => 1,
"int" => 1,
"boolean" => 1,
"double" => 1,
$this->me['string'] = $val;
break;
case 'i4':
+ case 'i8':
case 'int':
case 'double':
case 'string':
* Fails if the xmlrpc value is not an array and already initialized.
*
* @param mixed $val
- * @param string $type allowed values: i4, int, boolean, string, double, dateTime.iso8601, base64, null.
+ * @param string $type allowed values: i4, i8, int, boolean, string, double, dateTime.iso8601, base64, null.
*
* @return int 1 or 0 on failure
*/
break;
case static::$xmlrpcInt:
case static::$xmlrpcI4:
+ case static::$xmlrpcI8:
$rs .= "<${typ}>" . (int)$val . "</${typ}>";
break;
case static::$xmlrpcDouble:
/**
* Returns the type of the xmlrpc value.
*
- * For integers, 'int' is always returned in place of 'i4'.
+ * For integers, 'int' is always returned in place of 'i4' or 'i8'.
*
* @return string
*/
{
reset($this->me);
list($a,) = each($this->me);
- if ($a == static::$xmlrpcI4) {
+ if ($a == static::$xmlrpcI4 || $a == static::$xmlrpcI8) {
$a = static::$xmlrpcInt;
}
}
return;
case 1:
-// todo: handle i4 vs int
+// todo: handle i4/i8 vs int
reset($this->me);
list($type,) = each($this->me);
if ($type != $offset) {
case 2:
return isset($this->me['array'][$offset]);
case 1:
-// todo: handle i4 vs int
+// todo: handle i4/i8 vs int
return $offset == $this->scalartyp();
default:
return false;
throw new \Exception("XML-RPC Value is of type 'undef' and can not be accessed using array index");
}
}
-}
\ No newline at end of file
+}