summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2010-03-30 21:02:32 +0000
committerJohannes Schlüter <johannes@php.net>2010-03-30 21:02:32 +0000
commita6c9e432d457f24118965435aac727dbce4316f3 (patch)
tree04d8ccd6aaab0da1fd5c904eeb206ab790edcd87 /ext/reflection
parent347e2bce22c9240995b1d2b609c1bccde4f36740 (diff)
downloadphp-git-a6c9e432d457f24118965435aac727dbce4316f3.tar.gz
Use php_error_docref instead of zend_error
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/php_reflection.c22
-rw-r--r--ext/reflection/tests/bug42976.phpt4
2 files changed, 13 insertions, 13 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 66015707aa..44628f271b 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -79,7 +79,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
#define METHOD_NOTSTATIC(ce) \
if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) { \
- zend_error(E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C)); \
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C)); \
return; \
} \
@@ -97,7 +97,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
intern = (reflection_object *) zend_object_store_get_object(getThis() TSRMLS_CC); \
if (intern == NULL || intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
- zend_error(E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
} \
target = intern->ptr; \
@@ -1079,7 +1079,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
/* Is there a better way of doing this? */
while (func->fname) {
if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) {
- zend_error(E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
func++;
continue;
}
@@ -1427,7 +1427,7 @@ ZEND_METHOD(reflection, export)
}
if (!retval_ptr) {
- zend_error(E_WARNING, "%s::__toString() did not return anything", Z_OBJCE_P(object)->name);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::__toString() did not return anything", Z_OBJCE_P(object)->name);
RETURN_FALSE;
}
@@ -3895,7 +3895,7 @@ ZEND_METHOD(reflection_class, newInstance)
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
}
- zend_error(E_WARNING, "Invocation of %s's constructor failed", ce->name);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name);
RETURN_NULL();
}
if (retval_ptr) {
@@ -3975,7 +3975,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
}
- zend_error(E_WARNING, "Invocation of %s's constructor failed", ce->name);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name);
RETURN_NULL();
}
if (retval_ptr) {
@@ -4090,7 +4090,7 @@ ZEND_METHOD(reflection_class, isSubclassOf)
if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr TSRMLS_CC)) {
argument = (reflection_object *) zend_object_store_get_object(class_name TSRMLS_CC);
if (argument == NULL || argument->ptr == NULL) {
- zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
/* Bails out */
}
class_ce = argument->ptr;
@@ -4135,7 +4135,7 @@ ZEND_METHOD(reflection_class, implementsInterface)
if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr TSRMLS_CC)) {
argument = (reflection_object *) zend_object_store_get_object(interface TSRMLS_CC);
if (argument == NULL || argument->ptr == NULL) {
- zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
/* Bails out */
}
interface_ce = argument->ptr;
@@ -4520,7 +4520,7 @@ ZEND_METHOD(reflection_property, getValue)
if ((ref->prop.flags & ZEND_ACC_STATIC)) {
zend_update_class_constants(intern->ce TSRMLS_CC);
if (zend_hash_quick_find(CE_STATIC_MEMBERS(intern->ce), ref->prop.name, ref->prop.name_length + 1, ref->prop.h, (void **) &member) == FAILURE) {
- zend_error(E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop.name);
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop.name);
/* Bails out */
}
MAKE_COPY_ZVAL(member, return_value);
@@ -4575,7 +4575,7 @@ ZEND_METHOD(reflection_property, setValue)
prop_table = CE_STATIC_MEMBERS(intern->ce);
if (zend_hash_quick_find(prop_table, ref->prop.name, ref->prop.name_length + 1, ref->prop.h, (void **) &variable_ptr) == FAILURE) {
- zend_error(E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop.name);
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop.name);
/* Bails out */
}
if (*variable_ptr == value) {
@@ -4809,7 +4809,7 @@ ZEND_METHOD(reflection_extension, getFunctions)
/* Is there a better way of doing this? */
while (func->fname) {
if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) {
- zend_error(E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
func++;
continue;
}
diff --git a/ext/reflection/tests/bug42976.phpt b/ext/reflection/tests/bug42976.phpt
index 3669d957d3..2e4ade2847 100644
--- a/ext/reflection/tests/bug42976.phpt
+++ b/ext/reflection/tests/bug42976.phpt
@@ -28,11 +28,11 @@ string(9) "x.changed"
Warning: Parameter 1 to C::__construct() expected to be a reference, value given in %sbug42976.php on line 15
-Warning: Invocation of C's constructor failed in %sbug42976.php on line 15
+Warning: ReflectionClass::newInstance(): Invocation of C's constructor failed in %sbug42976.php on line 15
string(10) "x.original"
Warning: Parameter 1 to C::__construct() expected to be a reference, value given in %sbug42976.php on line 18
-Warning: Invocation of C's constructor failed in %sbug42976.php on line 18
+Warning: ReflectionClass::newInstanceArgs(): Invocation of C's constructor failed in %sbug42976.php on line 18
string(10) "x.original"
Done