Skip to content

Remove deprecated (real) cast #5220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 0 additions & 11 deletions Zend/tests/real_cast_deprecation.phpt

This file was deleted.

2 changes: 1 addition & 1 deletion Zend/zend_language_scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ NEWLINE ("\r"|"\n"|"\r\n")

<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"real"{TABS_AND_SPACES}")" {
if (PARSER_MODE()) {
zend_error(E_DEPRECATED, "The (real) cast is deprecated, use (float) instead");
zend_throw_exception(zend_ce_parse_error, "The (real) cast has been removed, use (float) instead", 0);
}
RETURN_TOKEN(T_DOUBLE_CAST);
}
Expand Down
2 changes: 1 addition & 1 deletion ext/tokenizer/tests/token_get_all_variation8.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Test token_get_all() function : usage variations - with type casting operators

echo "*** Testing token_get_all() : 'source' string with different type casting operators ***\n";

// type casting operators : (int), (integer), (float), (real), (double), (string), (array), (object), (bool), (boolean),(unset)
// type casting operators : (int), (integer), (float), (double), (string), (array), (object), (bool), (boolean),(unset)
$source = '<?php
$a = 1, $b = 10.5
$c = (int)$b + $a;
Expand Down
4 changes: 2 additions & 2 deletions ext/tokenizer/tokenizer_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_BOOL_CAST", T_BOOL_CAST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_UNSET_CAST", T_UNSET_CAST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_POW", T_POW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NEW", T_NEW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ELSEIF", T_ELSEIF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ELSE", T_ELSE, CONST_CS | CONST_PERSISTENT);
Expand All @@ -86,6 +85,7 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_EVAL", T_EVAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_INC", T_INC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DEC", T_DEC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NEW", T_NEW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ENDIF", T_ENDIF, CONST_CS | CONST_PERSISTENT);
Expand Down Expand Up @@ -213,7 +213,6 @@ char *get_token_type_name(int token_type)
case T_BOOL_CAST: return "T_BOOL_CAST";
case T_UNSET_CAST: return "T_UNSET_CAST";
case T_POW: return "T_POW";
case T_NEW: return "T_NEW";
case T_CLONE: return "T_CLONE";
case T_ELSEIF: return "T_ELSEIF";
case T_ELSE: return "T_ELSE";
Expand All @@ -229,6 +228,7 @@ char *get_token_type_name(int token_type)
case T_EVAL: return "T_EVAL";
case T_INC: return "T_INC";
case T_DEC: return "T_DEC";
case T_NEW: return "T_NEW";
case T_EXIT: return "T_EXIT";
case T_IF: return "T_IF";
case T_ENDIF: return "T_ENDIF";
Expand Down