]> granicus.if.org Git - php/commitdiff
Throw TypeError for invalid callback
authorAaron Piotrowski <aaron@trowski.com>
Mon, 6 Jul 2015 20:03:35 +0000 (15:03 -0500)
committerAaron Piotrowski <aaron@trowski.com>
Mon, 6 Jul 2015 20:03:35 +0000 (15:03 -0500)
Matches behavior of zend_internal_type_error() if E_ERROR is passed to
zend_wrong_callback_error().

Zend/zend_API.c

index 55d325c8faaa719777d4af60c64ea85659f16737..8b57457af2fb6221180114c418121530853087a3 100644 (file)
@@ -245,7 +245,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, cha
                zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a valid callback, %s",
                        class_name, space, get_active_function_name(), num, error);
        } else if (severity == E_ERROR) {
-               zend_throw_error(zend_ce_error, "%s%s%s() expects parameter %d to be a valid callback, %s",
+               zend_throw_error(zend_ce_type_error, "%s%s%s() expects parameter %d to be a valid callback, %s",
                        class_name, space, get_active_function_name(), num, error);
        } else {
                zend_error(severity, "%s%s%s() expects parameter %d to be a valid callback, %s",