]> granicus.if.org Git - php/commitdiff
Fixed error messages
authorDmitry Stogov <dmitry@zend.com>
Fri, 20 Mar 2015 14:26:12 +0000 (17:26 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 20 Mar 2015 14:26:12 +0000 (17:26 +0300)
Zend/zend_exceptions.c
tests/lang/catchable_error_002.phpt

index 46ad207087adcfa038cc40b185a7a0977d8c314f..b88c13e6d0ddd676ca84d4b00fe744a4a7199d8c 100644 (file)
@@ -909,7 +909,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
                zend_long line = zval_get_long(GET_PROPERTY_SILENT(&exception, "line"));
                zend_long code = zval_get_long(GET_PROPERTY_SILENT(&exception, "code"));
 
-               if (ce_exception == type_exception_ce) {
+               if (ce_exception == type_exception_ce && strstr(message->val, ", called in ")) {
                        zend_error_helper(code, file->val, line, "%s and defined", message->val);
                } else {
                        zend_error_helper(code, file->val, line, "%s", message->val);
index 04e19897f463de5fa2a7de57b3668a125b91f0b4..bc585f7b108f6bbe60b9f4a25978997a2b048f9a 100644 (file)
@@ -25,5 +25,5 @@ Catchable fatal error [2]
        echo "ALIVE!\n";
 ?>
 --EXPECTF--
-Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined in %scatchable_error_002.php on line %d
+Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d
 ALIVE!