Convert warnings to ValueError

This commit is contained in:
George Peter Banyard 2019-12-08 21:03:14 +01:00
parent 761e8c7707
commit 734932ecbb
3 changed files with 18 additions and 12 deletions

View file

@ -313,13 +313,13 @@ static PHP_FUNCTION(json_decode)
}
if (depth <= 0) {
php_error_docref(NULL, E_WARNING, "Depth must be greater than zero");
RETURN_NULL();
zend_value_error("Depth must be greater than zero");
return;
}
if (depth > INT_MAX) {
php_error_docref(NULL, E_WARNING, "Depth must be lower than %d", INT_MAX);
RETURN_NULL();
zend_value_error("Depth must be lower than %d", INT_MAX);
return;
}
/* For BC reasons, the bool $assoc overrides the long $options bit for PHP_JSON_OBJECT_AS_ARRAY */