本文整理汇总了PHP中Protocol::writeDouble方法的典型用法代码示例。如果您正苦于以下问题:PHP Protocol::writeDouble方法的具体用法?PHP Protocol::writeDouble怎么用?PHP Protocol::writeDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protocol
的用法示例。
在下文中一共展示了Protocol::writeDouble方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writeArg
public function writeArg($arg)
{
if (is_string($arg)) {
$this->protocol->writeString($arg);
} elseif (is_object($arg)) {
if (!$arg instanceof JavaType) {
error_log((string) new IllegalArgumentException($arg));
trigger_error("argument '" . get_class($arg) . "' is not a Java object,using NULL instead", E_USER_WARNING);
$this->protocol->writeObject(null);
} else {
$this->protocol->writeObject($arg->get__java());
}
} elseif (is_null($arg)) {
$this->protocol->writeObject(null);
} elseif (is_bool($arg)) {
$this->protocol->writeBoolean($arg);
} elseif (is_integer($arg)) {
$this->protocol->writeLong($arg);
} elseif (is_float($arg)) {
$this->protocol->writeDouble($arg);
} elseif (is_array($arg)) {
$wrote_begin = false;
foreach ($arg as $key => $val) {
if (is_string($key)) {
if (!$wrote_begin) {
$wrote_begin = 1;
$this->protocol->writeCompositeBegin_h();
}
$this->protocol->writePairBegin_s($key);
$this->writeArg($val);
$this->protocol->writePairEnd();
} else {
if (!$wrote_begin) {
$wrote_begin = 1;
$this->protocol->writeCompositeBegin_h();
}
$this->protocol->writePairBegin_n($key);
$this->writeArg($val);
$this->protocol->writePairEnd();
}
}
if (!$wrote_begin) {
$this->protocol->writeCompositeBegin_a();
}
$this->protocol->writeCompositeEnd();
}
}