Lines Matching defs:value
59 public static function divideInt64ToInt32($value, &$high, &$low, $trim = false)
61 $isNeg = (bccomp($value, 0) < 0);
63 $value = bcsub(0, $value);
66 $high = bcdiv($value, 4294967296);
67 $low = bcmod($value, 4294967296);
208 foreach ($var as $value) {
209 $tmp[] = $value;
234 foreach ($var as $key => $value) {
235 $tmp[$key] = $value;
243 throw new \Exception("Expect map field of value type.");
255 public static function Int64($value)
257 return new Int64($value);
260 public static function Uint64($value)
262 return new Uint64($value);
452 $value = new \Google\Protobuf\Timestamp();
454 $value->setSeconds($seconds);
455 $value->setNanos($nanoseconds);
456 return $value;
459 public static function formatTimestamp($value)
461 if (bccomp($value->getSeconds(), "253402300800") != -1) {
464 if (bccomp($value->getSeconds(), "-62135596801") != 1) {
467 $nanoseconds = static::getNanosecondsForTimestamp($value->getNanos());
471 $date = new \DateTime('@'.$value->getSeconds(), new \DateTimeZone("UTC"));
475 public static function parseDuration($value)
477 if (strlen($value) < 2 || substr($value, -1) !== "s") {
480 $number = substr($value, 0, -1);
505 public static function formatDuration($value)
507 if (bccomp($value->getSeconds(), '315576000001') != -1) {
510 if (bccomp($value->getSeconds(), '-315576000001') != 1) {
514 $nanos = $value->getNanos();
516 return (string) $value->getSeconds();
528 return bcadd($value->getSeconds(), $nanos, $digits);