Skip to content

Commit dabafc7

Browse files
authored
bool "must" be used instead. (php#14287)
1 parent 62ebe82 commit dabafc7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Zend/tests/type_declarations/union_types/redundant_types/bool_instead_false_and_true.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ function test(): false|true {
88

99
?>
1010
--EXPECTF--
11-
Fatal error: Type contains both true and false, bool should be used instead in %s on line %d
11+
Fatal error: Type contains both true and false, bool must be used instead in %s on line %d

Zend/tests/type_declarations/union_types/redundant_types/bool_instead_true_and_false.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ function test(): true|false {
88

99
?>
1010
--EXPECTF--
11-
Fatal error: Type contains both true and false, bool should be used instead in %s on line %d
11+
Fatal error: Type contains both true and false, bool must be used instead in %s on line %d

Zend/zend_compile.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6852,7 +6852,7 @@ static zend_type zend_compile_typename_ex(
68526852
if ( ((type_mask & MAY_BE_TRUE) && (single_type_mask == MAY_BE_FALSE))
68536853
|| ((type_mask & MAY_BE_FALSE) && (single_type_mask == MAY_BE_TRUE)) ) {
68546854
zend_error_noreturn(E_COMPILE_ERROR,
6855-
"Type contains both true and false, bool should be used instead");
6855+
"Type contains both true and false, bool must be used instead");
68566856
}
68576857
ZEND_TYPE_FULL_MASK(type) |= ZEND_TYPE_PURE_MASK(single_type);
68586858
ZEND_TYPE_FULL_MASK(single_type) &= ~_ZEND_TYPE_MAY_BE_MASK;

0 commit comments

Comments
 (0)