public static function safeDecode($string, $asArray = false)
    {
        if ($string === '' || $string === null) { // for PHP 7 compatibility
            $string = json_encode(null);
        }
        return json_decode($string, $asArray);
    }
public static function safeDecode($string, $asArray = false)
    {
        if ($string === '' || $string === null) { // for PHP 7 compatibility
            $string = json_encode(null);
        }
        return json_decode($string, $asArray);
    }
public static function safeDecode ( $ string , $ asArray = false ) { if ( $ string === '' || $ string === null ) { // for PHP 7 compatibility $ string = json_encode ( null ) ; } return json_decode ( $ string , $ asArray ) ; }
Decodes a JSON string

@param string $string
@param bool $asArray
@return mixed
Decodes a JSON string