]> granicus.if.org Git - php/commitdiff
- Provide better error message when using illegal function 'pointers'
authorMarcus Boerger <helly@php.net>
Fri, 16 Dec 2005 22:17:32 +0000 (22:17 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 16 Dec 2005 22:17:32 +0000 (22:17 +0000)
ext/spl/php_spl.c

index 686068eee5c73afefa9c348e3cd6f424127b3159..a003594f233196589c39333b373ca65ba6b8563d 100755 (executable)
@@ -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;