summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bz2/bz2.c2
-rw-r--r--ext/gd/gd.c12
-rw-r--r--ext/hash/hash.c4
-rw-r--r--ext/pcre/php_pcre.c2
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/spl/php_spl.c6
-rw-r--r--ext/standard/array.c26
-rwxr-xr-xext/standard/basic_functions.c2
-rw-r--r--ext/standard/dir.c6
-rw-r--r--ext/standard/exec.c4
-rw-r--r--ext/standard/filestat.c4
-rw-r--r--ext/standard/streamsfuncs.c12
-rw-r--r--ext/standard/string.c8
13 files changed, 45 insertions, 45 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index b32044e17e..9b84feafe1 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -380,7 +380,7 @@ static PHP_FUNCTION(bzopen)
if (CHECK_ZVAL_NULL_PATH(file)) {
zend_type_error("filename must not contain null bytes");
- return;
+ RETURN_THROWS();
}
stream = php_stream_bz2open(NULL, Z_STRVAL_P(file), mode, REPORT_ERRORS, NULL);
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 60c38b6207..9714f3bc38 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -3902,7 +3902,7 @@ PHP_FUNCTION(imageaffine)
break;
default:
zend_type_error("Invalid type for element %i", i);
- return;
+ RETURN_THROWS();
}
}
}
@@ -3976,7 +3976,7 @@ PHP_FUNCTION(imageaffinematrixget)
double x, y;
if (!options || Z_TYPE_P(options) != IS_ARRAY) {
zend_type_error("Array expected as options when using translate or scale");
- return;
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(options), "x", sizeof("x") - 1)) != NULL) {
@@ -4008,7 +4008,7 @@ PHP_FUNCTION(imageaffinematrixget)
if (!options) {
zend_type_error("Number is expected as option when using rotate or shear");
- return;
+ RETURN_THROWS();
}
angle = zval_get_double(options);
@@ -4074,7 +4074,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
break;
default:
zend_type_error("Matrix 1 contains invalid type for element %i", i);
- return;
+ RETURN_THROWS();
}
}
@@ -4091,7 +4091,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
break;
default:
zend_type_error("Matrix 2 contains invalid type for element %i", i);
- return;
+ RETURN_THROWS();
}
}
}
@@ -4285,7 +4285,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
zend_type_error("Invalid 2nd parameter, filename must not contain null bytes");
- return;
+ RETURN_THROWS();
}
stream = php_stream_open_wrapper(Z_STRVAL_P(to_zval), "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index e51308c4de..60ab85379e 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -873,12 +873,12 @@ PHP_FUNCTION(hash_equals)
/* We only allow comparing string to prevent unexpected results. */
if (Z_TYPE_P(known_zval) != IS_STRING) {
zend_type_error("Expected known_string to be a string, %s given", zend_zval_type_name(known_zval));
- return;
+ RETURN_THROWS();
}
if (Z_TYPE_P(user_zval) != IS_STRING) {
zend_type_error("Expected user_string to be a string, %s given", zend_zval_type_name(user_zval));
- return;
+ RETURN_THROWS();
}
if (Z_STRLEN_P(known_zval) != Z_STRLEN_P(user_zval)) {
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index f5f1d6f70e..9305fca71c 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -2259,7 +2259,7 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter)
} else {
if (Z_TYPE_P(regex) != IS_ARRAY) {
zend_type_error("Parameter mismatch, pattern is a string while replacement is an array");
- return;
+ RETURN_THROWS();
}
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 957a866177..61a0de16d6 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -6260,7 +6260,7 @@ ZEND_METHOD(reflection_reference, fromArrayElement)
item = zend_symtable_find(ht, Z_STR_P(key));
} else {
zend_type_error("Key must be array or string");
- return;
+ RETURN_THROWS();
}
if (!item) {
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 06371b741d..5c42801a75 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -94,7 +94,7 @@ PHP_FUNCTION(class_parents)
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
zend_type_error("object or string expected");
- return;
+ RETURN_THROWS();
}
if (Z_TYPE_P(obj) == IS_STRING) {
@@ -127,7 +127,7 @@ PHP_FUNCTION(class_implements)
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
zend_type_error("object or string expected");
- return;
+ RETURN_THROWS();
}
if (Z_TYPE_P(obj) == IS_STRING) {
@@ -156,7 +156,7 @@ PHP_FUNCTION(class_uses)
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
zend_type_error("object or string expected");
- return;
+ RETURN_THROWS();
}
if (Z_TYPE_P(obj) == IS_STRING) {
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 6c5d9251f2..f8d4256aee 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1258,7 +1258,7 @@ PHP_FUNCTION(min)
if (Z_TYPE(args[0]) != IS_ARRAY) {
zend_type_error("When only one parameter is given, it must be an array");
- return;
+ RETURN_THROWS();
} else {
if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0)) != NULL) {
ZVAL_COPY_DEREF(return_value, result);
@@ -1305,7 +1305,7 @@ PHP_FUNCTION(max)
if (Z_TYPE(args[0]) != IS_ARRAY) {
zend_type_error("When only one parameter is given, it must be an array");
- return;
+ RETURN_THROWS();
} else {
if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1)) != NULL) {
ZVAL_COPY_DEREF(return_value, result);
@@ -3785,7 +3785,7 @@ static zend_always_inline void php_array_replace_wrapper(INTERNAL_FUNCTION_PARAM
if (Z_TYPE_P(arg) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(arg));
- return;
+ RETURN_THROWS();
}
}
@@ -3829,7 +3829,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET
if (Z_TYPE_P(arg) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(arg));
- return;
+ RETURN_THROWS();
}
count += zend_hash_num_elements(Z_ARRVAL_P(arg));
}
@@ -4721,7 +4721,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(&args[i]));
- return;
+ RETURN_THROWS();
}
}
@@ -5126,7 +5126,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(&args[i]));
- return;
+ RETURN_THROWS();
}
}
@@ -5468,7 +5468,7 @@ PHP_FUNCTION(array_diff)
if (Z_TYPE(args[0]) != IS_ARRAY) {
zend_type_error("Expected parameter 1 to be an array, %s given", zend_zval_type_name(&args[0]));
- return;
+ RETURN_THROWS();
}
num = zend_hash_num_elements(Z_ARRVAL(args[0]));
@@ -5476,7 +5476,7 @@ PHP_FUNCTION(array_diff)
for (i = 1; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(&args[i]));
- return;
+ RETURN_THROWS();
}
}
RETURN_EMPTY_ARRAY();
@@ -5493,7 +5493,7 @@ PHP_FUNCTION(array_diff)
for (i = 1; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(&args[i]));
- return;
+ RETURN_THROWS();
}
}
RETURN_EMPTY_ARRAY();
@@ -5504,7 +5504,7 @@ PHP_FUNCTION(array_diff)
for (i = 1; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(&args[i]));
- return;
+ RETURN_THROWS();
}
if (!found) {
ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL(args[i]), value) {
@@ -5534,7 +5534,7 @@ PHP_FUNCTION(array_diff)
for (i = 1; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 1, zend_zval_type_name(&args[i]));
- return;
+ RETURN_THROWS();
}
num += zend_hash_num_elements(Z_ARRVAL(args[i]));
}
@@ -6186,7 +6186,7 @@ PHP_FUNCTION(array_map)
if (Z_TYPE(arrays[0]) != IS_ARRAY) {
zend_type_error("Expected parameter 2 to be an array, %s given", zend_zval_type_name(&arrays[0]));
- return;
+ RETURN_THROWS();
}
maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[0]));
@@ -6228,7 +6228,7 @@ PHP_FUNCTION(array_map)
if (Z_TYPE(arrays[i]) != IS_ARRAY) {
zend_type_error("Expected parameter %d to be an array, %s given", i + 2, zend_zval_type_name(&arrays[i]));
efree(array_pos);
- return;
+ RETURN_THROWS();
}
if (zend_hash_num_elements(Z_ARRVAL(arrays[i])) > maxlen) {
maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[i]));
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 2f3edb9af3..59e31b5e62 100755
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3203,7 +3203,7 @@ PHP_FUNCTION(register_tick_function)
efree(tick_fe.arguments);
zend_type_error("Invalid tick callback '%s' passed", ZSTR_VAL(function_name));
zend_string_release_ex(function_name, 0);
- return;
+ RETURN_THROWS();
} else if (function_name) {
zend_string_release_ex(function_name, 0);
}
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 36a5512b5d..2e4637e78c 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -260,7 +260,7 @@ PHP_FUNCTION(closedir)
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
zend_type_error("%d is not a valid Directory resource", dirp->res->handle);
- return;
+ RETURN_THROWS();
}
res = dirp->res;
@@ -374,7 +374,7 @@ PHP_FUNCTION(rewinddir)
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
zend_type_error("%d is not a valid Directory resource", dirp->res->handle);
- return;
+ RETURN_THROWS();
}
php_stream_rewinddir(dirp);
@@ -393,7 +393,7 @@ PHP_NAMED_FUNCTION(php_if_readdir)
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
zend_type_error("%d is not a valid Directory resource", dirp->res->handle);
- return;
+ RETURN_THROWS();
}
if (php_stream_readdir(dirp, &entry)) {
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 21ebba891d..4825fc02a5 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -485,7 +485,7 @@ PHP_FUNCTION(escapeshellcmd)
if (command_len) {
if (command_len != strlen(command)) {
zend_type_error("Input string contains NULL bytes");
- return;
+ RETURN_THROWS();
}
RETVAL_STR(php_escape_shell_cmd(command));
} else {
@@ -507,7 +507,7 @@ PHP_FUNCTION(escapeshellarg)
if (argument_len != strlen(argument)) {
zend_type_error("Input string contains NULL bytes");
- return;
+ RETURN_THROWS();
}
RETVAL_STR(php_escape_shell_arg(argument));
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 04f85d2677..6f521ed60c 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -354,7 +354,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
value = Z_STRVAL_P(group);
} else {
zend_type_error("Parameter 2 should be string or int, %s given", zend_zval_type_name(group));
- return;
+ RETURN_THROWS();
}
if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
@@ -383,7 +383,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
}
} else {
zend_type_error("Parameter 2 should be string or int, %s given", zend_zval_type_name(group));
- return;
+ RETURN_THROWS();
}
/* Check the basedir */
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index cc93849a1a..31e9c141d8 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -969,7 +969,7 @@ PHP_FUNCTION(stream_context_get_options)
context = decode_context_param(zcontext);
if (!context) {
zend_type_error("Invalid stream/context parameter");
- return;
+ RETURN_THROWS();
}
ZVAL_COPY(return_value, &context->options);
@@ -994,7 +994,7 @@ PHP_FUNCTION(stream_context_set_option)
/* figure out where the context is coming from exactly */
if (!(context = decode_context_param(zcontext))) {
zend_type_error("Invalid stream/context parameter");
- return;
+ RETURN_THROWS();
}
RETURN_BOOL(parse_context_options(context, options) == SUCCESS);
@@ -1013,7 +1013,7 @@ PHP_FUNCTION(stream_context_set_option)
/* figure out where the context is coming from exactly */
if (!(context = decode_context_param(zcontext))) {
zend_type_error("Invalid stream/context parameter");
- return;
+ RETURN_THROWS();
}
RETURN_BOOL(php_stream_context_set_option(context, wrappername, optionname, zvalue) == SUCCESS);
@@ -1036,7 +1036,7 @@ PHP_FUNCTION(stream_context_set_params)
context = decode_context_param(zcontext);
if (!context) {
zend_type_error("Invalid stream/context parameter");
- return;
+ RETURN_THROWS();
}
RETVAL_BOOL(parse_context_params(context, params) == SUCCESS);
@@ -1057,7 +1057,7 @@ PHP_FUNCTION(stream_context_get_params)
context = decode_context_param(zcontext);
if (!context) {
zend_type_error("Invalid stream/context parameter");
- return;
+ RETURN_THROWS();
}
array_init(return_value);
@@ -1680,7 +1680,7 @@ PHP_FUNCTION(sapi_windows_vt100_support)
"%s() was not able to analyze the specified stream",
get_active_function_name()
);
- return;
+ RETURN_THROWS();
}
/* Check if the file descriptor is a console */
diff --git a/ext/standard/string.c b/ext/standard/string.c
index f4c9bf55f1..d2cc1bb4a1 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1277,7 +1277,7 @@ PHP_FUNCTION(implode)
if (pieces == NULL) {
if (arg1_array == NULL) {
zend_type_error("Argument must be an array");
- return;
+ RETURN_THROWS();
}
arg1_str = ZSTR_EMPTY_ALLOC();
@@ -1285,7 +1285,7 @@ PHP_FUNCTION(implode)
} else {
if (arg1_str == NULL) {
zend_type_error("The first argument must be a string");
- return;
+ RETURN_THROWS();
}
}
@@ -3251,10 +3251,10 @@ PHP_FUNCTION(strtr)
if (ac == 2 && from_ht == NULL) {
zend_type_error("If two arguments are passed, the second argument must be an array");
- return;
+ RETURN_THROWS();
} else if (ac != 2 && from_str == NULL) {
zend_type_error("If three arguments are passed, the second argument must be a string");
- return;
+ RETURN_THROWS();
}
/* shortcut for empty string */