dsp Thu Mar 20 00:55:26 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/general_functions bug44487.phpt
Modified files: /php-src NEWS /php-src/ext/standard basic_functions.c Log: MFH: Fix bug #44487 (call_user_method_array issues a warning when throwing an exception). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1122&r2=1.2027.2.547.2.1123&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1122 php-src/NEWS:1.2027.2.547.2.1123 --- php-src/NEWS:1.2027.2.547.2.1122 Wed Mar 19 03:00:40 2008 +++ php-src/NEWS Thu Mar 20 00:55:26 2008 @@ -18,6 +18,8 @@ again...). (Felipe) - Fixed bug #41828 (Failing to call RecursiveIteratorIterator::__construct() causes a sefault). (Etienne) +- Fixed bug #44487 (call_user_method_array issues a warning when throwing + an exception). (David Soria Parra) 06 Mar 2008, PHP 5.2.6RC2 - Fixed bug #44333 (SEGFAULT when using mysql_pconnect() with client_flags). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.68&r2=1.725.2.31.2.69&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.68 php-src/ext/standard/basic_functions.c:1.725.2.31.2.69 --- php-src/ext/standard/basic_functions.c:1.725.2.31.2.68 Mon Dec 31 07:20:12 2007 +++ php-src/ext/standard/basic_functions.c Thu Mar 20 00:55:26 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.725.2.31.2.68 2007/12/31 07:20:12 sebastian Exp $ */ +/* $Id: basic_functions.c,v 1.725.2.31.2.69 2008/03/20 00:55:26 dsp Exp $ */ #include "php.h" #include "php_streams.h" @@ -5219,8 +5219,10 @@ SEPARATE_ZVAL(params[0]); convert_to_string(*params[0]); - if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); + if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL TSRMLS_CC) == SUCCESS) { + if (retval_ptr) { + COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); + } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_PP(params[0])); } @@ -5261,8 +5263,10 @@ element++; } - if (call_user_function_ex(EG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); + if (call_user_function_ex(EG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) { + if (retval_ptr) { + COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); + } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_PP(method_name)); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug44487.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/general_functions/bug44487.phpt +++ php-src/ext/standard/tests/general_functions/bug44487.phpt --TEST-- Bug #44487 (call_user_method_array issues a warning when throwing an exception) --INI-- error_reporting = E_ALL & ~E_DEPRECATED --FILE-- <?php class Foo { public function test() { print 'test'; throw new Exception(); } } try { $bar = new Foo(); call_user_method_array('test', $bar, array()) ; } catch (Exception $e) { } ?> --EXPECT-- test -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php