private static function recursiveDecode(&$bytes)
    {
        // Grab the first byte
        $first = array_shift($bytes);

        // Get the major type
        $major = $first & MajorType::BIT_MASK;
        $additional = $first & AdditionalType::BIT_MASK;

        switch($major)
        {
            case MajorType::POSITIVE_INT:
                return self::decodeIntValue($additional, $bytes);

            case MajorType::NEGATIVE_INT:
                $decoded = self::decodeIntValue($additional, $bytes);

                // Apply negative number logic
                $decoded += 1;
                $decoded *= -1;

                return $decoded;

            case MajorType::BYTE_STRING:
                return self::decodeByteString($additional, $bytes);

            case MajorType::UTF8_STRING:
                return self::decodeString($additional, $bytes);

            case MajorType::SEQUENCE:
                return self::decodeSequence($additional, $bytes);

            case MajorType::MAP:
                return self::decodeMap($additional, $bytes);

            case MajorType::SIMPLE_AND_FLOAT:
                return self::decodeSimple($additional, $bytes);

            default:
                return self::decodeTag($additional, $bytes);
        }
    }
private static function recursiveDecode(&$bytes)
    {
        // Grab the first byte
        $first = array_shift($bytes);

        // Get the major type
        $major = $first & MajorType::BIT_MASK;
        $additional = $first & AdditionalType::BIT_MASK;

        switch($major)
        {
            case MajorType::POSITIVE_INT:
                return self::decodeIntValue($additional, $bytes);

            case MajorType::NEGATIVE_INT:
                $decoded = self::decodeIntValue($additional, $bytes);

                // Apply negative number logic
                $decoded += 1;
                $decoded *= -1;

                return $decoded;

            case MajorType::BYTE_STRING:
                return self::decodeByteString($additional, $bytes);

            case MajorType::UTF8_STRING:
                return self::decodeString($additional, $bytes);

            case MajorType::SEQUENCE:
                return self::decodeSequence($additional, $bytes);

            case MajorType::MAP:
                return self::decodeMap($additional, $bytes);

            case MajorType::SIMPLE_AND_FLOAT:
                return self::decodeSimple($additional, $bytes);

            default:
                return self::decodeTag($additional, $bytes);
        }
    }
private static function recursiveDecode ( & $ bytes ) { // Grab the first byte $ first = array_shift ( $ bytes ) ; // Get the major type $ major = $ first & MajorType :: BIT_MASK ; $ additional = $ first & AdditionalType :: BIT_MASK ; switch ( $ major ) { case MajorType :: POSITIVE_INT : return self :: decodeIntValue ( $ additional , $ bytes ) ; case MajorType :: NEGATIVE_INT : $ decoded = self :: decodeIntValue ( $ additional , $ bytes ) ; // Apply negative number logic $ decoded += 1 ; $ decoded *= - 1 ; return $ decoded ; case MajorType :: BYTE_STRING : return self :: decodeByteString ( $ additional , $ bytes ) ; case MajorType :: UTF8_STRING : return self :: decodeString ( $ additional , $ bytes ) ; case MajorType :: SEQUENCE : return self :: decodeSequence ( $ additional , $ bytes ) ; case MajorType :: MAP : return self :: decodeMap ( $ additional , $ bytes ) ; case MajorType :: SIMPLE_AND_FLOAT : return self :: decodeSimple ( $ additional , $ bytes ) ; default : return self :: decodeTag ( $ additional , $ bytes ) ; } }
Does a decode from an array of bytes passed by reference.

@param array $bytes Byte array.
@return mixed Decoded value.
@throws CborException If the byte array is not valid.
Does a decode from an array of bytes passed by reference .