From: Scott MacVicar Date: Thu, 14 May 2009 22:00:38 +0000 (+0000) Subject: Throw an error rather than silently changing to the default. X-Git-Tag: php-5.4.0alpha1~191^2~3661 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58247606a05d33e4b98d0f859d8db2f0a4979d21;p=php Throw an error rather than silently changing to the default. --- diff --git a/ext/json/json.c b/ext/json/json.c index d9616ca7fd..b8bcad21cf 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -536,7 +536,8 @@ static PHP_FUNCTION(json_decode) } if (depth <= 0) { - depth = JSON_PARSER_DEFAULT_DEPTH; + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must greater than zero."); + RETURN_NULL(); } ALLOC_INIT_ZVAL(z);