johannes Tue, 30 Mar 2010 21:02:32 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=297203
Log: Use php_error_docref instead of zend_error Changed paths: U php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c U php/php-src/branches/PHP_5_3/ext/reflection/tests/bug42976.phpt U php/php-src/trunk/ext/reflection/php_reflection.c U php/php-src/trunk/ext/reflection/tests/bug42976.phpt
Modified: php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c 2010-03-30 20:50:42 UTC (rev 297202) +++ php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c 2010-03-30 21:02:32 UTC (rev 297203) @@ -79,7 +79,7 @@ #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 @@ 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 @@ /* 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ /* 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; } Modified: php/php-src/branches/PHP_5_3/ext/reflection/tests/bug42976.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/reflection/tests/bug42976.phpt 2010-03-30 20:50:42 UTC (rev 297202) +++ php/php-src/branches/PHP_5_3/ext/reflection/tests/bug42976.phpt 2010-03-30 21:02:32 UTC (rev 297203) @@ -28,11 +28,11 @@ 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 Modified: php/php-src/trunk/ext/reflection/php_reflection.c =================================================================== --- php/php-src/trunk/ext/reflection/php_reflection.c 2010-03-30 20:50:42 UTC (rev 297202) +++ php/php-src/trunk/ext/reflection/php_reflection.c 2010-03-30 21:02:32 UTC (rev 297203) @@ -79,7 +79,7 @@ #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 @@ 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 @@ /* 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ /* 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; } Modified: php/php-src/trunk/ext/reflection/tests/bug42976.phpt =================================================================== --- php/php-src/trunk/ext/reflection/tests/bug42976.phpt 2010-03-30 20:50:42 UTC (rev 297202) +++ php/php-src/trunk/ext/reflection/tests/bug42976.phpt 2010-03-30 21:02:32 UTC (rev 297203) @@ -28,11 +28,11 @@ 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
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php