lib/blobfolio/common/data.php
public static function json_decode_array($json, $defaults=null, bool $strict=true, bool $recursive=true) {
		ref\format::json_decode($json);

		if ((null === $json) || (\is_string($json) && ! $json)) {
			$json = array();
		}
		else {
			ref\cast::array($json);
		}

		if (\is_array($defaults)) {
			return static::parse_args($json, $defaults, $strict, $recursive);
		}
		else {
			return $json;
		}
	}
public static function json_decode_array($json, $defaults=null, bool $strict=true, bool $recursive=true) {
		ref\format::json_decode($json);

		if ((null === $json) || (\is_string($json) && ! $json)) {
			$json = array();
		}
		else {
			ref\cast::array($json);
		}

		if (\is_array($defaults)) {
			return static::parse_args($json, $defaults, $strict, $recursive);
		}
		else {
			return $json;
		}
	}
public static function json_decode_array ( $ json , $ defaults = null , bool $ strict = true , bool $ recursive = true ) { ref \ format :: json_decode ( $ json ) ; if ( ( null === $ json ) || ( \ is_string ( $ json ) && ! $ json ) ) { $ json = array ( ) ; } else { ref \ cast :: array ( $ json ) ; } if ( \ is_array ( $ defaults ) ) { return static :: parse_args ( $ json , $ defaults , $ strict , $ recursive ) ; } else { return $ json ; } }
JSON Decode As Array

This ensures a JSON string is always decoded to
an array, optionally matching the structure of
a template object.

@param string $json JSON.
@param mixed $defaults Template.
@param bool $strict Enforce types if templating.
@param bool $recursive Recursive templating.
@return array Data.
JSON Decode As Array