Decode Array collection
@param $data
@return array|bool
977828
private static function decode($data) {
		if((is_array($data) && isset($data[0])) || (isset($data[0]) && !is_string($data[0]))) {
			return self::parseArray($data);
		} else if (is_null($data) || is_scalar($data)) {
			return $data;
		} else {
			return self::decodeNewObject($data);
		}
	}
344705
static public function decode($data)
	{
	    return json_decode($data, true) ? : ($data && $data!='\"\"' && $data !='false' ? $data : null);
	}
1142291
private function decodePacketHeader($data)
    {
        $ret = array();
        $ret['version']       = ord($data{0});
        $ret['type']          = ord($data{1});
        $ret['requestId']     = (ord($data{2}) << 8) + ord($data{3});
        $ret['contentLength'] = (ord($data{4}) << 8) + ord($data{5});
        $ret['paddingLength'] = ord($data{6});
        $ret['reserved']      = ord($data{7});
        return $ret;
    }
669217
public function decode($data)
    {
        $decoded = @json_decode($data, $this->getDecodeAssoc(), $this->getDecodeDepth(), $this->getDecodeOptions());

        if (null === $decoded && json_last_error() !== JSON_ERROR_NONE) {
            throw new \RuntimeException('Decoding JSON failed: ' . json_last_error_msg());
        }

        return $decoded;
    }
303797
public function decodeOID($data)
    {
        $bin_data      = array();
        $index         = 0;
        $binary_string = '';
        $oid           = array();

        // first two numbers are: (40*x)+y
        // all next chars are 7-bit numbers
        foreach ($data as $key => $value) {
            $bin_data[$index] = bitConv($value);
            $binary_string   .= $bin_data[$index];
            $index++;
        }

        $oid[0] = (int)($data[0] / 0x28);
        $oid[1] = $data[0] % 0x28;

        $elements    = count($bin_data);
        $temp_number = '00000000';

        for ($x = 1; $x < $elements; $x++) {
            $and_temp = $bin_data[$x] & '01111111';

            $temp_number = bitAdd($temp_number, $and_temp);

            if (substr($bin_data[$x], 0, 1) == '0') {
                // This is a final value without
                // a value preceeding it.
                $oid[$x + 1] = decConv($temp_number);
                $temp_number = '';
            } else {
                $temp_number = shiftLeft($temp_number, 7);
            }
        }

        $oid_string = '';

        foreach ($oid as $key => $value) {
            $oid_string .= $value . ".";
        }

        $oid_string = substr($oid_string, 0, -1);

        return $oid_string;
    }
817378
private function parse(array $data)
    {
        $result = array();

        foreach ($data as $index => $array) {
            if ($this->serializer->isSerialized($array[ConstProviderInterface::CACHE_PARAM_VALUE])) {
                $array[ConstProviderInterface::CACHE_PARAM_VALUE] = $this->serializer->unserialize($array[ConstProviderInterface::CACHE_PARAM_VALUE]);
            }

            $result[$array[ConstProviderInterface::CACHE_PARAM_KEY]] = array(
                ConstProviderInterface::CACHE_PARAM_VALUE => $array[ConstProviderInterface::CACHE_PARAM_VALUE], 
                ConstProviderInterface::CACHE_PARAM_TTL => $array[ConstProviderInterface::CACHE_PARAM_TTL], 
                ConstProviderInterface::CACHE_PARAM_CREATED_ON => $array[ConstProviderInterface::CACHE_PARAM_CREATED_ON]
            );
        }

        return $result;
    }
615480
protected function parseQueryPair(string $data): array
    {
        $data = explode('=', $data, 2);
        if (1 === count($data)) {
            $data[] = '';
        }

        return array_map(__NAMESPACE__ . '\decode', $data);
    }
948208
public function decode($data): array
    {
        // Try native PECL YAML PHP extension first if available.
        if (\function_exists('yaml_parse') && $this->useNativeDecoder()) {
            // Safely decode YAML.
            $saved = @ini_get('yaml.decode_php');
            @ini_set('yaml.decode_php', '0');
            $decoded = @yaml_parse($data);
            @ini_set('yaml.decode_php', $saved);

            if ($decoded !== false) {
                return $decoded;
            }
        }

        try {
            return YamlParser::parse($data);
        } catch (ParseException $e) {
            if ($this->useCompatibleDecoder()) {
                return (array) FallbackYamlParser::parse($data);
            }

            throw new \RuntimeException('Decoding YAML failed: ' . $e->getMessage(), 0, $e);
        }
    }
77472
public function decode($data)
    {
        $xml = simplexml_load_string($data, "SimpleXMLElement", LIBXML_NOCDATA);
        $json = json_encode($xml);
        $this->arrayData = json_decode($json, true);
        return $this->arrayData;
    }
238364
public function decode($data)
    {
        $decoded = @unserialize($data, $this->getOptions());

        if ($decoded === false && $data !== serialize(false)) {
            throw new \RuntimeException('Decoding serialized data failed');
        }

        return $this->preserveLines($decoded, ['\\n', '\\r'], ["\n", "\r"]);
    }
166953
public function decode($data): array
    {
        $result = RequestContext::getServerBean($this->formatHandlerClass)->decode($data);
        if(!is_array($result))
        {
            $result = [];
        }
        return $result;
    }
1077849
public function decode($data)
    {
        $data = \preg_replace('/[^0-9A-Fa-f]/', '', \rtrim($data, '>'));
        if ((\strlen($data) % 2) === 1) {
            $data .= '0';
        }

        return \pack('H*', $data);
    }
194485
public function decrypt($data) {
        if (is_array($data)) return array_map([$this, __FUNCTION__], $data);
        $raw = base64_decode($data);
        openssl_public_decrypt($raw, $result, $this->key);
        return $result;
    }
15743
public function decode(string $data): string
    {
        $this->validateInput($data);

        $data = str_split($data);
        $data = array_map(function ($character) {
            return strpos($this->options["characters"], $character);
        }, $data);

        $leadingZeroes = 0;
        while (!empty($data) && 0 === $data[0]) {
            $leadingZeroes++;
            array_shift($data);
        }

        $converted = $this->baseConvert($data, 58, 256);

        if (0 < $leadingZeroes) {
            $converted = array_merge(
                array_fill(0, $leadingZeroes, 0),
                $converted
            );
        }

        $decoded = implode("", array_map("chr", $converted));
        if (true === $this->options["check"]) {
            $hash = substr($decoded, 0, -(Base58::CHECKSUM_SIZE));
            $hash = hash("sha256", $hash, true);
            $hash = hash("sha256", $hash, true);
            $checksum = substr($hash, 0, Base58::CHECKSUM_SIZE);

            if (0 !== substr_compare($decoded, $checksum, -(Base58::CHECKSUM_SIZE))) {
                $message = sprintf(
                    'Checksum "%s" does not match the expected "%s"',
                    bin2hex(substr($decoded, -(Base58::CHECKSUM_SIZE))),
                    bin2hex($checksum)
                );
                throw new RuntimeException($message);
            }

            $version = substr($decoded, 0, Base58::VERSION_SIZE);
            $version = ord($version);

            if ($version !==  $this->options["version"]) {
                $message = sprintf(
                    'Version "%s" does not match the expected "%s"',
                    $version,
                    $this->options["version"]
                );
                throw new RuntimeException($message);
            }

            $decoded = substr($decoded, Base58::VERSION_SIZE, -(Base58::CHECKSUM_SIZE));
        }
        return $decoded;
    }
560395
protected function asArray($data)
  {
    $array = [];
    
    foreach(get_object_vars((object)$data) as $k => $v){
      if ( is_object($v) ){
        $array[$k] = $this->asArray($v);
      }
      else {
        $array[$k] = $v;
      }
    }
    
    return $array;
  }
1220548
private function decodeArray($array) {

        $return_value = array();

        foreach ( $array->data->value as $value ) {

            $return_value[] = $this->decodeValue($value);

        }

        return $return_value;

    }
1321905
protected static function _decodeSubIDs(string $data): array
    {
        $subids = [];
        $idx = 0;
        $end = strlen($data);
        while ($idx < $end) {
            $num = gmp_init("0", 10);
            while (true) {
                if ($idx >= $end) {
                    throw new DecodeException("Unexpected end of data.");
                }
                $byte = ord($data[$idx++]);
                $num |= $byte & 0x7f;
                // bit 8 of the last octet is zero
                if (!($byte & 0x80)) {
                    break;
                }
                $num <<= 7;
            }
            $subids[] = $num;
        }
        return $subids;
    }