From: Marcus Boerger Date: Fri, 16 Dec 2005 22:17:32 +0000 (+0000) Subject: - Provide better error message when using illegal function 'pointers' X-Git-Tag: php-5.1.2RC1~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57492cc2d4258ba08d3aa347b96cab2a0d89377d;p=php - Provide better error message when using illegal function 'pointers' --- diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 686068eee5..a003594f23 100755 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -403,7 +403,7 @@ PHP_FUNCTION(spl_autoload_register) } } - if (!zend_is_callable_ex(zcallable, IS_CALLABLE_CHECK_IS_STATIC, &func_name, &func_name_len, &alfi.ce, &alfi.func_ptr, &obj_ptr TSRMLS_CC)) { + if (!zend_is_callable_ex(zcallable, IS_CALLABLE_STRICT, &func_name, &func_name_len, &alfi.ce, &alfi.func_ptr, &obj_ptr TSRMLS_CC)) { if (Z_TYPE_P(zcallable) == IS_ARRAY) { if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) { if (do_throw) { @@ -413,13 +413,13 @@ PHP_FUNCTION(spl_autoload_register) return; } else if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify a callable %smethod", !obj_ptr ? "static " : ""); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : ""); } efree(func_name); return; } else if (Z_TYPE_P(zcallable) == IS_STRING) { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not found", func_name); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not %s", func_name, alfi.func_ptr ? "callable" : "found"); } efree(func_name); return;