-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Produce a sensible error message for the case where inheritance should fail. There is still a remaining issue that we sometimes fail inheritance while we should not.
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Zend/tests/type_declarations/variance/class_order_autoload_error7.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
Bug #78647: Outstanding dependency obligation | ||
--FILE-- | ||
<?php | ||
|
||
spl_autoload_register(function ($class) { | ||
if ($class == 'A') { | ||
class A { | ||
function m(): B {} | ||
} | ||
} elseif ($class == 'B') { | ||
class B extends A { | ||
function m(): X {} | ||
} | ||
} else { | ||
class C extends B {} | ||
} | ||
}); | ||
|
||
new B; | ||
|
||
?> | ||
--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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters