Decode values for passed settings associative array
@param array $settingsAssoc
@return mixed
510855
static public function decodeValues(array $settingsAssoc) {
        foreach ($settingsAssoc as $key => &$value) {
            $value = static::decodeValue($value);
        }
        return $settingsAssoc;
    }
219095
public static function decode($string, $assoc = true)
    {
        $result = self::decodeRecursive($string, $assoc);
        return $result[0];
    }
1307434
function _prepareValue($value, $assoc)
    {
        if (null === $value) {
            return null;
        } elseif (!$assoc) {
            return $value;
        } else {
            $name = $this->getName();
            if (!strpos($name, '[')) {
                return array($name => $value);
            } else {
                $keys = str_replace(
                    array('\\', '\'', ']', '['), array('\\\\', '\\\'', '', "']['"),
                    $name
                );
                $keysArray = explode("']['", $keys);
                return HTML_QuickForm_utils::recursiveBuild($keysArray, $value);
            }
        }
    }
103520
public function jsonDecodeFilter($str, $assoc = false, $depth = 512, $options = 0)
    {
        return json_decode(html_entity_decode($str), $assoc, $depth, $options);
    }
904434
protected function getAttributes(ResourceSettings $settings) : string
    {
        $attributes = [
            $this->getLocation($settings->head),
        ];

        if ($settings->async) {
            $attributes[] = 'async';
        }

        if ($settings->defer) {
            $attributes[] = 'defer';
        }

        return implode('_', $attributes);
    }
472764
protected function _decodeArray()
    {
        $result = array();
        $starttok = $tok = $this->_getNextToken(); // Move past the '['
        $index  = 0;

        while ($tok && $tok != self::RBRACKET) {
            $result[$index++] = $this->_decodeValue();

            $tok = $this->_token;

            if ($tok == self::RBRACKET || !$tok) {
                break;
            }

            if ($tok != self::COMMA) {
                throw new Zend_Json_Exception('Missing "," in array encoding: ' . $this->_source);
            }

            $tok = $this->_getNextToken();
        }

        $this->_getNextToken();
        return($result);
    }
688249
public function decode(string $input, int $maxSize) { /* : ?array */
        $headers = [];
        $off = 0;
        $inputLength = \strlen($input);
        $size = 0;

        // dynamic $table as per 2.3.2
        while ($off < $inputLength) {
            $index = \ord($input[$off++]);

            if ($index & 0x80) {
                // range check
                if ($index <= self::LAST_INDEX + 0x80) {
                    if ($index === 0x80) {
                        return null;
                    }

                    list($name, $value) = $headers[] = self::TABLE[$index - 0x81];
                } else {
                    if ($index == 0xff) {
                        $index = self::decodeDynamicInteger($input, $off) + 0xff;
                    }

                    $index -= 0x81 + self::LAST_INDEX;
                    if (!isset($this->headers[$index])) {
                        return null;
                    }

                    list($name, $value) = $headers[] = $this->headers[$index];
                }
            } elseif (($index & 0x60) !== 0x20) { // (($index & 0x40) || !($index & 0x20)): bit 4: never index is ignored
                $dynamic = (bool) ($index & 0x40);

                if ($index & ($dynamic ? 0x3f : 0x0f)) { // separate length
                    if ($dynamic) {
                        if ($index === 0x7f) {
                            $index = self::decodeDynamicInteger($input, $off) + 0x3f;
                        } else {
                            $index &= 0x3f;
                        }
                    } else {
                        $index &= 0x0f;
                        if ($index === 0x0f) {
                            $index = self::decodeDynamicInteger($input, $off) + 0x0f;
                        }
                    }

                    if ($index <= self::LAST_INDEX) {
                        $header = self::TABLE[$index - 1];
                    } else {
                        $header = $this->headers[$index - 1 - self::LAST_INDEX];
                    }
                } else {
                    $len = \ord($input[$off++]);
                    $huffman = $len & 0x80;
                    $len &= 0x7f;

                    if ($len === 0x7f) {
                        $len = self::decodeDynamicInteger($input, $off) + 0x7f;
                    }

                    if ($inputLength - $off < $len || $len <= 0) {
                        return null;
                    }

                    if ($huffman) {
                        $header = [self::huffmanDecode(\substr($input, $off, $len))];
                    } else {
                        $header = [\substr($input, $off, $len)];
                    }

                    $off += $len;
                }

                if ($off === $inputLength) {
                    return null;
                }

                $len = \ord($input[$off++]);
                $huffman = $len & 0x80;
                $len &= 0x7f;

                if ($len === 0x7f) {
                    $len = self::decodeDynamicInteger($input, $off) + 0x7f;
                }

                if ($inputLength - $off < $len || $len < 0) {
                    return null;
                }

                if ($huffman) {
                    $header[1] = self::huffmanDecode(\substr($input, $off, $len));
                } else {
                    $header[1] = \substr($input, $off, $len);
                }

                $off += $len;

                if ($dynamic) {
                    \array_unshift($this->headers, $header);
                    $this->size += 32 + \strlen($header[0]) + \strlen($header[1]);
                    if ($this->maxSize < $this->size) {
                        $this->resizeTable();
                    }
                }

                list($name, $value) = $headers[] = $header;
            } else { // if ($index & 0x20) {
                if ($index === 0x3f) {
                    $index = self::decodeDynamicInteger($input, $off) + 0x40;
                }

                if ($index > 4096) { // initial limit … may be adjusted??
                    return null;
                }

                $name = $value = '';
                $this->resizeTable($index);
            }

            $size += \strlen($name) + \strlen($value);

            if ($size > $maxSize) {
                return null;
            }
        }

        return $headers;
    }
875368
public function getKey($field, $assoc = false)
    {
        return $assoc ? $this->get($assoc)[$field] : $this->get($assoc)->{$field};
    }
887600
public static function decode($json, $assoc = false, $options = 0)
    {
        if (!is_string($json)) {
            throw new \InvalidArgumentException('Argument json is not a string');
        }
        $result = json_decode($json, (bool) $assoc, 512, (int) $options);
        if ($result === null) {
            throw new \RuntimeException(static::$errorMessages[json_last_error()]);
        }

        return $result;
    }
145370
function assoc_to_uri($array) {
		$temp=array ();
		foreach ( ( array ) $array as $key => $val ) {
			$temp[]=$key;
			$temp[]=$val;
		}

		return implode('/', $temp);
	}
448944
static public function selectAssoc($keysColumn = null, $valuesColumn = null, array $conditions = [], \Closure $configurator = null) {
        if ($keysColumn === null) {
            $keysColumn = static::getKeysColumnName();
        }
        if ($valuesColumn === null) {
            $valuesColumn = static::getValuesColumnName();
        }
        return static::decodeValues(parent::selectAssoc($keysColumn, $valuesColumn, $conditions, $configurator));
    }
845490
protected function resolveContext(array $context = [])
    {
        return array_merge([
            'json_decode_assoc' => $this->assoc,
            'json_decode_depth' => $this->depth,
            'json_decode_options' => $this->optionsMask,
        ], $context);
    }
624139
protected function jsonDecode(Field $f, $value, $assoc = true)
    {
        // constant supported only starting PHP 7.3
        if (!defined('JSON_THROW_ON_ERROR')) {
            define('JSON_THROW_ON_ERROR', 0);
        }

        $res = json_decode($value, $assoc, 512, JSON_THROW_ON_ERROR);
        if (JSON_THROW_ON_ERROR == 0 && json_last_error() !== JSON_ERROR_NONE) {
            throw new Exception([
                'There was error while decoding JSON',
                'code'  => json_last_error(),
                'error' => json_last_error_msg(),
            ]);
        }

        return $res;
    }
993047
protected function initObject(array $settings): array
    {
        $settings += static::$settings ?? [];
        foreach ($settings as $name => &$value) {
            $propertyName = null;
            if (property_exists($this, $name)) {
                $propertyName = $name;
                unset($settings[$name]);
            }

            if ($propertyName !== null
                && property_exists($this, NameConverter::snakeCaseToLowerCamelCase($name))) {
                $propertyName = NameConverter::snakeCaseToLowerCamelCase($name);
                unset($settings[$name]);
            }

            if (!$propertyName) {
                continue;
            }

            $methodName = 'set' . ucfirst($propertyName);
            if (is_callable([$this, $methodName])) {
                $this->{$methodName}($value);
                continue;
            }

            if (array_key_exists($propertyName, get_object_vars($this))) {
                $this->{$propertyName} = $value;
            }
        }

        unset($value);

        return $settings;
    }
890384
protected function processValue(
        $value,
        array $settings,
        /*# bool */ $between = false
    )/*# : string */ {
        if (is_object($value)) {
            return $this->quoteObject($value, $settings);
        } elseif (is_array($value)) {
            return $this->processArrayValue($value, $settings, $between);
        } else {
            return $this->processScalarValue($value);
        }
    }
194564
public function decodeFile($file, $assoc = true, $depth = 512, $options = 0)
    {
        set_error_handler(
                create_function(
                        '$severity, $message, $file, $line', 'throw new ErrorException($message, $severity, $severity, $file, $line);'
                )
        );
        
        try
        {
            $jsonData = file_get_contents($file);
        }
        catch (Exception $e)
        {
            throw new RuntimeException(sprintf($e->getMessage()));
        }

        restore_error_handler();
        
        if(false === $jsonData)
        {
            throw new RuntimeException(sprintf('Unable to get file %s', $file));
        }
        
        return $this->decode($jsonData, $assoc, $depth, $options);
    }
890205
public static function decodeRecursive($string, $assoc = false)
    {
        list($firstHex, $firstOctal) = self::analyzeFirstChar($string[0]);

        switch (true) {
            case $firstOctal === '8': // fixmap 1000xxxx
            case $firstHex === 'de': // map 16
            case $firstHex === 'df': // map 32
                return self::decodeMap($string, $assoc);
            case $firstOctal === '9': // fixarray 1001xxxx
            case $firstHex === 'dc': // array 16
            case $firstHex === 'dd': // array 32
                return self::decodeArray($string, $assoc);
            case hexdec($firstHex) < pow(2, 7): // fixint 0xxxxxxx
            case hexdec($firstOctal) > 13: // negative fixint 111xxxxx
            case $firstHex === 'cc': // uint 8
            case $firstHex === 'cd': // uint 16
            case $firstHex === 'ce': // uint 32
            case $firstHex === 'cf': // uint 64
            case $firstHex === 'd0': // int 8
            case $firstHex === 'd1': // int 16
            case $firstHex === 'd2': // int 32
            case $firstHex === 'd3': // int 64
                return self::decodeInt($string);
            case in_array(hexdec($firstOctal), array(10, 11)): // fixstr 101xxxxx
            case $firstHex === 'd9': // str 8
            case $firstHex === 'da': // str 16
            case $firstHex === 'db': // str 32
                return self::decodeString($string);
            case $firstHex === 'c2': // false
                return array(false, substr($string, 1));
            case $firstHex === 'c3': // true
                return array(true, substr($string, 1));
            case $firstHex === 'c0': // nil
                return array(null, substr($string, 1));
            default:
                throw new UndecodeableException($firstHex . ' is not a valid identifier for a type.', 1);
        }
    }