lib/Elastica/JSON.php
public static function parse($args/* inherit from json_decode */)
    {
        // extract arguments
        $args = \func_get_args();

        // default to decoding into an assoc array
        if (1 === \count($args)) {
            $args[] = true;
        }

        // run decode
        $array = \call_user_func_array('json_decode', $args);

        // turn errors into exceptions for easier catching
        if ($error = self::getJsonLastErrorMsg()) {
            throw new JSONParseException($error);
        }

        // output
        return $array;
    }
public static function parse($args/* inherit from json_decode */)
    {
        // extract arguments
        $args = \func_get_args();

        // default to decoding into an assoc array
        if (1 === \count($args)) {
            $args[] = true;
        }

        // run decode
        $array = \call_user_func_array('json_decode', $args);

        // turn errors into exceptions for easier catching
        if ($error = self::getJsonLastErrorMsg()) {
            throw new JSONParseException($error);
        }

        // output
        return $array;
    }
public static function parse ( $ args /* inherit from json_decode */ ) { // extract arguments $ args = \ func_get_args ( ) ; // default to decoding into an assoc array if ( 1 === \ count ( $ args ) ) { $ args [ ] = true ; } // run decode $ array = \ call_user_func_array ( 'json_decode' , $ args ) ; // turn errors into exceptions for easier catching if ( $ error = self :: getJsonLastErrorMsg ( ) ) { throw new JSONParseException ( $ error ) ; } // output return $ array ; }
Parse JSON string to an array.

@see http://php.net/manual/en/function.json-decode.php
@see http://php.net/manual/en/function.json-last-error.php

@param string $args,... JSON string to parse

@throws JSONParseException

@return array PHP array representation of JSON string
Parse JSON string to an array .