public static function decode($encoded)
    {
        // Trying to decode null, eh?
        if (is_null($encoded) || empty($encoded))
        {
            return null;
        }

        // Unpack into array of characters
        $chars = str_split($encoded);

        // Convert the character array to an array of bytes
        $bytes = array();
        foreach ($chars as $char)
        {
            $bytes[] = ord($char);
        }

        $val = self::recursiveDecode($bytes);

        if (!empty($bytes))
        {
            throw new CborException("There are more bytes than expected in the CBOR byte array.");
        }

        return $val;
    }
public static function decode($encoded)
    {
        // Trying to decode null, eh?
        if (is_null($encoded) || empty($encoded))
        {
            return null;
        }

        // Unpack into array of characters
        $chars = str_split($encoded);

        // Convert the character array to an array of bytes
        $bytes = array();
        foreach ($chars as $char)
        {
            $bytes[] = ord($char);
        }

        $val = self::recursiveDecode($bytes);

        if (!empty($bytes))
        {
            throw new CborException("There are more bytes than expected in the CBOR byte array.");
        }

        return $val;
    }
public static function decode ( $ encoded ) { // Trying to decode null, eh? if ( is_null ( $ encoded ) || empty ( $ encoded ) ) { return null ; } // Unpack into array of characters $ chars = str_split ( $ encoded ) ; // Convert the character array to an array of bytes $ bytes = array ( ) ; foreach ( $ chars as $ char ) { $ bytes [ ] = ord ( $ char ) ; } $ val = self :: recursiveDecode ( $ bytes ) ; if ( ! empty ( $ bytes ) ) { throw new CborException ( "There are more bytes than expected in the CBOR byte array." ) ; } return $ val ; }
Decodes the supplied CBOR string.

@param string $encoded Data to decode.
@throws CborException If there are bytes left over after decoding.
@return mixed Decoded result.
Decodes the supplied CBOR string .