|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-12-19 04:11 UTC] carl at thep dot lu dot se
The set_error_handler() function is not accepting class methods as of the php4-ze2 CVS code from 19-Dec-2002. It does work with php 4.3 and ZE1. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 06:00:02 2025 UTC |
This can be fixed quite easily: Index: Zend/zend_builtin_functions.c =================================================================== RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v retrieving revision 1.184 diff -u -r1.184 zend_builtin_functions.c --- Zend/zend_builtin_functions.c 8 Apr 2003 18:22:32 -0000 1.184 +++ Zend/zend_builtin_functions.c 18 Apr 2003 21:49:51 -0000 @@ -967,13 +967,21 @@ ZEND_FUNCTION(set_error_handler) { zval **error_handler; + char *error_handler_name; zend_bool had_orig_error_handler=0; if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - convert_to_string_ex(error_handler); + if (!zend_is_callable(*error_handler, 0, &error_handler_name)) { + zend_error(E_WARNING, "%s() expects argument 1, '%s', to be a valid callback", + get_active_function_name(TSRMLS_C), error_handler_name); + efree(error_handler_name); + return; + } + efree(error_handler_name); + if (EG(user_error_handler)) { had_orig_error_handler = 1; *return_value = *EG(user_error_handler);