]> granicus.if.org Git - php/commitdiff
Use php_error_docref instead of zend_error
authorJohannes Schlüter <johannes@php.net>
Tue, 30 Mar 2010 21:02:32 +0000 (21:02 +0000)
committerJohannes Schlüter <johannes@php.net>
Tue, 30 Mar 2010 21:02:32 +0000 (21:02 +0000)
ext/reflection/php_reflection.c
ext/reflection/tests/bug42976.phpt

index 66015707aa484873c32aee77d4e5697191ffb6cd..44628f271b187efd528fd0f23e2bdc16cd8e45d9 100644 (file)
@@ -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;
                        }
index 3669d957d3b3216d992090872053eab3333e41dc..2e4ade28476ef11e2a6add174b93c4494ba53d1b 100644 (file)
@@ -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