summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>1999-09-22 09:46:44 +0000
committerThies C. Arntzen <thies@php.net>1999-09-22 09:46:44 +0000
commit5f3515652a93f10604a6ebbf5662a6031a0137f0 (patch)
tree9385f00500150bb0d9c7af5d2ba949648e179915
parent8b4000f4cb95bae969ecb1eb83e4f802c70695d3 (diff)
downloadphp-git-5f3515652a93f10604a6ebbf5662a6031a0137f0.tar.gz
if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found!
-rw-r--r--Zend/zend_list.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index 0c5862a064..ddc215ce4f 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -154,10 +154,12 @@ ZEND_API void *zend_fetch_resource_ex(zval *passed_id, int default_id, char *res
if (default_id==-1) { /* use id */
if (!passed_id) {
- zend_error(E_WARNING, "No %s resource supplied", resource_type_name);
+ if (resource_type_name)
+ zend_error(E_WARNING, "No %s resource supplied", resource_type_name);
return NULL;
} else if (passed_id->type != IS_RESOURCE) {
- zend_error(E_WARNING, "Supplied argument is not a valid %s resource", resource_type_name);
+ if (resource_type_name)
+ zend_error(E_WARNING, "Supplied argument is not a valid %s resource", resource_type_name);
return NULL;
}
id = passed_id->value.lval;
@@ -167,7 +169,8 @@ ZEND_API void *zend_fetch_resource_ex(zval *passed_id, int default_id, char *res
resource = zend_list_find(id, &actual_resource_type);
if (!resource) {
- zend_error(E_WARNING, "%d is not a valid %s resource", id, resource_type_name);
+ if (resource_type_name)
+ zend_error(E_WARNING, "%d is not a valid %s resource", id, resource_type_name);
return NULL;
}