Amfphp_Core_Amf_Deserializer::readDouble PHP Method

readDouble() protected method

readDouble reads the floating point value from the bytes stream and properly orders the bytes depending on the system architecture.
protected readDouble ( ) : float
return float The floating point value of the next 8 bytes
    protected function readDouble()
    {
        $bytes = substr($this->rawData, $this->currentByte, 8);
        $this->currentByte += 8;
        if (Amfphp_Core_Amf_Util::isSystemBigEndian()) {
            $bytes = strrev($bytes);
        }
        $zz = unpack('dflt', $bytes);
        // unpack the bytes
        return $zz['flt'];
        // return the number from the associative array
    }

Usage Example

コード例 #1
0
 /**
  * reaad double
  * @return float
  */
 public function readDouble()
 {
     return parent::readDouble();
 }