protected function setSingleValue(&$array, $index, $value) { $array[$index] = TypeConversionUtil::parseShort($value); }
} /** * @param string $v * @return int */ public static function parseInt($v) { return intval($v); } /** * for large values we make long as double. * @param string $v * @return long (double) */ public static function parseLong($v) { return doubleval($v); } /** * @param string $v * @return short (int) */ public static function parseShort($v) { return intval($v); } } // workaround for initializing static variable TypeConversionUtil::$TWO_TO_63 = bcpow('2', '63'); TypeConversionUtil::$TWO_TO_64 = bcpow('2', '64');
public function writeLong($fieldValue) { //echo "fieldValue = $fieldValue and is type ".gettype($fieldValue).($fieldValue>0?' PLUS ':' MINUS'); class_exists('TypeConversionUtil') || (include GWTPHP_DIR . '/util/TypeConversionUtil.class.php'); //$this->writeString((string)TypeConversionUtil::dec2hex($fieldValue)); $this->append(TypeConversionUtil::dectoBase64($fieldValue)); }