From c9db32271a8083721582c5ec1dd09c4d4f562c74 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Fri, 28 Feb 2020 12:13:03 +0100 Subject: [PATCH] Remove deprecated (real) cast Closes GH-5220 --- Zend/tests/real_cast_deprecation.phpt | 11 ----------- Zend/zend_language_scanner.l | 2 +- ext/tokenizer/tests/token_get_all_variation8.phpt | 2 +- ext/tokenizer/tokenizer_data.c | 4 ++-- 4 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 Zend/tests/real_cast_deprecation.phpt diff --git a/Zend/tests/real_cast_deprecation.phpt b/Zend/tests/real_cast_deprecation.phpt deleted file mode 100644 index a73517c504..0000000000 --- a/Zend/tests/real_cast_deprecation.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -The (real) cast is deprecated ---FILE-- - ---EXPECTF-- -Deprecated: The (real) cast is deprecated, use (float) instead in %s on line %d -float(42) diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index a4e8b6f7be..285ade26df 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1496,7 +1496,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "("{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); } diff --git a/ext/tokenizer/tests/token_get_all_variation8.phpt b/ext/tokenizer/tests/token_get_all_variation8.phpt index 015e60d6e3..14a051955e 100644 --- a/ext/tokenizer/tests/token_get_all_variation8.phpt +++ b/ext/tokenizer/tests/token_get_all_variation8.phpt @@ -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 = '