diff --git a/Zend/tests/type_declarations/variance/class_order_autoload_error7.phpt b/Zend/tests/type_declarations/variance/class_order_autoload_error7.phpt new file mode 100644 index 00000000000..c4b4cc05ee7 --- /dev/null +++ b/Zend/tests/type_declarations/variance/class_order_autoload_error7.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #78647: Outstanding dependency obligation +--FILE-- + +--EXPECTF-- +Fatal error: Could not check compatibility between B::m(): X and A::m(): B, because class X is not available in %s on line %d diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index b30bb523d36..57314d78448 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2548,7 +2548,8 @@ static void report_variance_errors(zend_class_entry *ce) { } else if (obligation->type == OBLIGATION_PROPERTY_COMPATIBILITY) { emit_incompatible_property_error(obligation->child_prop, obligation->parent_prop); } else { - zend_error_noreturn(E_CORE_ERROR, "Bug #78647"); + /* Report variance errors of the dependency, which prevent it from being linked. */ + report_variance_errors(obligation->dependency_ce); } } ZEND_HASH_FOREACH_END();