-
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.
Fix bug pointed out in feature request 81268
The error message which is generated when one tries to assign null to an intersection type property is wrong and misleading
- Loading branch information
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Zend/tests/type_declarations/intersection_types/bug81268.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,12 @@ | ||
--TEST-- | ||
Bug #81268 Wrong message when using null as a default value for intersection types | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
public X&Y $y = null; | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use null as default value for property Test::$y of type X&Y 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