public static function decodeAnyMessages($anyArray)
    {
        $results = [];
        foreach ($anyArray as $any) {
            try {
                /** @var Any $any */
                /** @var Message $unpacked */
                $unpacked = $any->unpack();
                $results[] = self::serializeToPhpArray($unpacked);
            } catch (\Exception $ex) {
                echo "$ex\n";
                // failed to unpack the $any object - show as unknown binary data
                $results[] = [
                    'typeUrl' => $any->getTypeUrl(),
                    'value' => '<Unknown Binary Data>',
                ];
            }
        }
        return $results;
    }
public static function decodeAnyMessages($anyArray)
    {
        $results = [];
        foreach ($anyArray as $any) {
            try {
                /** @var Any $any */
                /** @var Message $unpacked */
                $unpacked = $any->unpack();
                $results[] = self::serializeToPhpArray($unpacked);
            } catch (\Exception $ex) {
                echo "$ex\n";
                // failed to unpack the $any object - show as unknown binary data
                $results[] = [
                    'typeUrl' => $any->getTypeUrl(),
                    'value' => '<Unknown Binary Data>',
                ];
            }
        }
        return $results;
    }
public static function decodeAnyMessages ( $ anyArray ) { $ results = [ ] ; foreach ( $ anyArray as $ any ) { try { /** @var Any $any */ /** @var Message $unpacked */ $ unpacked = $ any -> unpack ( ) ; $ results [ ] = self :: serializeToPhpArray ( $ unpacked ) ; } catch ( \ Exception $ ex ) { echo "$ex\n" ; // failed to unpack the $any object - show as unknown binary data $ results [ ] = [ 'typeUrl' => $ any -> getTypeUrl ( ) , 'value' => '<Unknown Binary Data>' , ] ; } } return $ results ; }
Decode an array of Any messages into a printable PHP array.

@param $anyArray
@return array
Decode an array of Any messages into a printable PHP array .