Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing iface class const inheritance type check
- Loading branch information
Showing
2 changed files
with
37 additions
and
20 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Zend/tests/type_declarations/typed_class_constants_inheritance_error6.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,16 @@ | ||
--TEST-- | ||
Typed class constants (type widening iface class const) | ||
--FILE-- | ||
<?php | ||
|
||
interface A { | ||
public const string CONST1 = 'A'; | ||
} | ||
|
||
class B implements A { | ||
public const CONST1 = 'B'; | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Type of B::CONST1 must be compatible with A::CONST1 of type string 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