Skip to content

Commit 64b9cdf

Browse files
committed
Change (real) cast to throw a Parse Error
1 parent aef958b commit 64b9cdf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Zend/zend_language_scanner.l

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,12 @@ NEWLINE ("\r"|"\n"|"\r\n")
14941494
RETURN_TOKEN(T_DOUBLE_CAST);
14951495
}
14961496

1497+
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"real"{TABS_AND_SPACES}")" {
1498+
if (PARSER_MODE()) {
1499+
zend_error(E_PARSE, "The (real) cast has been removed, use (float) instead");
1500+
}
1501+
}
1502+
14971503
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}("string"|"binary"){TABS_AND_SPACES}")" {
14981504
RETURN_TOKEN(T_STRING_CAST);
14991505
}

0 commit comments

Comments
 (0)