3 namespace Abraham\TwitterOAuth\Util;
6 * @author louis <louis@systemli.org>
11 * Decodes a JSON string to stdObject or associative array
13 * @param string $string
14 * @param bool $asArray
16 * @return array|object
18 public static function decode($string, $asArray)
20 if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) {
21 return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING);
24 return json_decode($string, $asArray);