Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/tests/type_casts/non_canonical_binary_cast.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ var_dump((binary) 42);
?>
--EXPECTF--
Deprecated: Non-canonical cast (binary) is deprecated, use the (string) cast instead in %s on line %d
int(42)
string(2) "42"
2 changes: 1 addition & 1 deletion Zend/tests/type_casts/non_canonical_boolean_cast.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ var_dump((boolean) 42);
?>
--EXPECTF--
Deprecated: Non-canonical cast (boolean) is deprecated, use the (bool) cast instead in %s on line %d
int(42)
bool(true)
2 changes: 1 addition & 1 deletion Zend/tests/type_casts/non_canonical_double_cast.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ var_dump((double) 42);
?>
--EXPECTF--
Deprecated: Non-canonical cast (double) is deprecated, use the (float) cast instead in %s on line %d
int(42)
float(42)
6 changes: 3 additions & 3 deletions Zend/zend_language_scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
if (PARSER_MODE()) {
zend_error(E_DEPRECATED, "Non-canonical cast (double) is deprecated, use the (float) cast instead");
}
RETURN_TOKEN(T_INT_CAST);
RETURN_TOKEN(T_DOUBLE_CAST);
}

<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"real"{TABS_AND_SPACES}")" {
Expand All @@ -1667,7 +1667,7 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
if (PARSER_MODE()) {
zend_error(E_DEPRECATED, "Non-canonical cast (binary) is deprecated, use the (string) cast instead");
}
RETURN_TOKEN(T_INT_CAST);
RETURN_TOKEN(T_STRING_CAST);
}

<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" {
Expand All @@ -1686,7 +1686,7 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
if (PARSER_MODE()) {
zend_error(E_DEPRECATED, "Non-canonical cast (boolean) is deprecated, use the (bool) cast instead");
}
RETURN_TOKEN(T_INT_CAST);
RETURN_TOKEN(T_BOOL_CAST);
}

<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}("unset"){TABS_AND_SPACES}")" {
Expand Down