// sprintf('%F') could be most likely ok but it fails eg. on 2e-14.
// The code below tries its best at keeping max precision while avoiding exp notation,
// but there is of course no limit in the number of decimal places to be used...
- $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, 128, '.', '')) . "</${typ}>";
+ $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</${typ}>";
break;
case static::$xmlrpcDateTime:
if (is_string($val)) {
* Return next member element for xmlrpc values of type struct.
*
* @return Value
- * @throw \Error starting with php 8.0, this function should not be used, as it will always throw
+ * @throws \Error starting with php 8.0, this function should not be used, as it will always throw
*
* @deprecated iterate directly over the object using foreach instead
*/
*
* @return \ArrayIterator
*/
- public function getIterator() {
+ public function getIterator()
+ {
switch ($this->mytype) {
case 3:
return new \ArrayIterator($this->me['struct']);
}
}
- public function offsetSet($offset, $value) {
-
+ public function offsetSet($offset, $value)
+ {
switch ($this->mytype) {
case 3:
if (!($value instanceof \PhpXmlRpc\Value)) {
}
}
- public function offsetExists($offset) {
+ public function offsetExists($offset)
+ {
switch ($this->mytype) {
case 3:
return isset($this->me['struct'][$offset]);
}
}
- public function offsetUnset($offset) {
+ public function offsetUnset($offset)
+ {
switch ($this->mytype) {
case 3:
unset($this->me['struct'][$offset]);
}
}
- public function offsetGet($offset) {
+ public function offsetGet($offset)
+ {
switch ($this->mytype) {
case 3:
return isset($this->me['struct'][$offset]) ? $this->me['struct'][$offset] : null;