Could not check compatibility between %s and %s, because class %s is not available¶
Description¶
This error message signals that PHP could not find all the needed classes and interfaces to reach a conclusion about the compatibility of V
, compared to W
.
PHP checks all the classes and interfaces whose definitions are already known, and, eventually, calls autoload to get the missing classes. When all avenues are exhausted, PHP yields this error.
In fact, if checking compatibility fails, the code will not run later anyway.
Example¶
<?php
class V {
function foo() : X { }
}
class W extends W {
function foo() : Y { }
}
?>
Literal Examples¶
Could not check compatibility between V::foo() and W::foo(), because class X is not available
Solutions¶
Use existing classes or interfaces as type.
Fix typos in type names.
Add any missing class or interface.