Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8141 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3931 invoked by uid 1010); 26 Feb 2004 03:14:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3882 invoked from network); 26 Feb 2004 03:14:57 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.185) by pb1.pair.com with SMTP; 26 Feb 2004 03:14:57 -0000 Received: from [212.227.126.155] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AwBzE-0004K4-00 for internals@lists.php.net; Thu, 26 Feb 2004 04:14:56 +0100 Received: from [80.139.1.157] (helo=[80.139.1.157]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AwBzE-0007NQ-00 for internals@lists.php.net; Thu, 26 Feb 2004 04:14:56 +0100 To: internals@lists.php.net In-Reply-To: <5.1.0.14.2.20040225164026.02c28540@127.0.0.1> References: <5.1.0.14.2.20040225164026.02c28540@127.0.0.1> Content-Type: multipart/mixed; boundary="=-A5txukk7QDAE+2Wisb2J" Message-ID: <1077765027.685.145.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 26 Feb 2004 04:10:27 +0100 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:e958292ea7b1c44e51b2b9ca0a9da460 Subject: Re: Fwd: [PHP-DEV] RC1 From: thekid@thekid.de (Timm Friebe) --=-A5txukk7QDAE+2Wisb2J Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote: > Quick reminder... > If you have any bugs to fix, please fix them in the coming days. Not a bug, but a feature request - make set_exception_handler() accept the meta-type "callable" instead of only strings. - Timm --=-A5txukk7QDAE+2Wisb2J Content-Disposition: attachment; filename=zend_builtin_functions.diff Content-Type: text/x-patch; name=zend_builtin_functions.diff; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Index: Zend/zend_builtin_functions.c =================================================================== RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v retrieving revision 1.223 diff -u -r1.223 zend_builtin_functions.c --- Zend/zend_builtin_functions.c 25 Feb 2004 21:06:59 -0000 1.223 +++ Zend/zend_builtin_functions.c 26 Feb 2004 03:13:17 -0000 @@ -1000,18 +1000,26 @@ /* }}} */ -/* {{{ proto string set_exception_handler(string exception_handler) +/* {{{ proto string set_exception_handler(callable exception_handler) Sets a user-defined exception handler function. Returns the previously defined exception handler, or false on error */ ZEND_FUNCTION(set_exception_handler) { zval **exception_handler; + char *exception_handler_name = NULL; zend_bool had_orig_exception_handler=0; if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &exception_handler)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - convert_to_string_ex(exception_handler); + if (!zend_is_callable(*exception_handler, 0, &exception_handler_name)) { + zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback", + get_active_function_name(TSRMLS_C), exception_handler_name?exception_handler_name:"unknown"); + efree(exception_handler_name); + return; + } + efree(exception_handler_name); + if (EG(user_exception_handler)) { had_orig_exception_handler = 1; *return_value = *EG(user_exception_handler); --=-A5txukk7QDAE+2Wisb2J--