Amfphp_Core_Amf_Deserializer::readAmf3Data PHP Method

readAmf3Data() public method

read the type byte, then call the corresponding amf3 data reading function
public readAmf3Data ( ) : mixed
return mixed
    public function readAmf3Data()
    {
        $type = $this->readByte();
        switch ($type) {
            case 0x0:
                return new Amfphp_Core_Amf_Types_Undefined();
            case 0x1:
                return null;
                //null
            //null
            case 0x2:
                return false;
                //boolean false
            //boolean false
            case 0x3:
                return true;
                //boolean true
            //boolean true
            case 0x4:
                return $this->readAmf3Int();
            case 0x5:
                return $this->readDouble();
            case 0x6:
                return $this->readAmf3String();
            case 0x7:
                return $this->readAmf3XmlDocument();
            case 0x8:
                return $this->readAmf3Date();
            case 0x9:
                return $this->readAmf3Array();
            case 0xa:
                return $this->readAmf3Object();
            case 0xb:
                return $this->readAmf3Xml();
            case 0xc:
                return $this->readAmf3ByteArray();
            case 0xd:
            case 0xe:
            case 0xf:
            case 0x10:
                return $this->readAmf3Vector($type);
            case 0x11:
                throw new Amfphp_Core_Exception('dictionaries not supported, as it is not possible to use an object as array key in PHP ');
            default:
                throw new Amfphp_Core_Exception('undefined Amf3 type encountered: ' . $type);
        }
    }

Usage Example

コード例 #1
0
 /**
  * read amf3 data
  * @return mixed
  */
 public function readAmf3Data()
 {
     return parent::readAmf3Data();
 }