]> granicus.if.org Git - php/commitdiff
Deprecate is_real() function
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 11 Jul 2019 15:18:01 +0000 (17:18 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 22 Jul 2019 09:39:52 +0000 (11:39 +0200)
Zend/zend_compile.c
ext/standard/basic_functions.c
ext/standard/tests/general_functions/is_float.phpt
ext/standard/tests/general_functions/is_float_64bit.phpt

index 7570e39dfe6fb7584ac4deaa86e8d82b5c4af3ac..40b29058bc9a4ef765f7f2d74cf3e54b7d54b683 100644 (file)
@@ -3708,7 +3708,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
                return zend_compile_func_typecheck(result, args, IS_LONG);
        } else if (zend_string_equals_literal(lcname, "is_float")
                || zend_string_equals_literal(lcname, "is_double")
-               || zend_string_equals_literal(lcname, "is_real")
        ) {
                return zend_compile_func_typecheck(result, args, IS_DOUBLE);
        } else if (zend_string_equals_literal(lcname, "is_string")) {
index 0e11c1c088faa301a7c14eef3ecefecd167d2fd6..42815ca6f1b119d6ce026f2052b3edbdd9c755ee 100644 (file)
@@ -3109,7 +3109,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
        PHP_FALIAS(is_integer,                  is_int,                                                                 arginfo_is_int)
        PHP_FALIAS(is_long,                             is_int,                                                                 arginfo_is_int)
        PHP_FALIAS(is_double,                   is_float,                                                               arginfo_is_float)
-       PHP_FALIAS(is_real,                             is_float,                                                               arginfo_is_float)
+       PHP_DEP_FALIAS(is_real,                 is_float,                                                               arginfo_is_float)
        PHP_FE(is_numeric,                                                                                                              arginfo_is_numeric)
        PHP_FE(is_string,                                                                                                               arginfo_is_string)
        PHP_FE(is_array,                                                                                                                arginfo_is_array)
index cec0e445ab623379a56d1aeacad8029df070de13..6d4ada6701922e557c8734e1ba7927c78605998f 100644 (file)
@@ -51,7 +51,7 @@ foreach ($floats as $float ) {
   echo "-- Iteration $loop_counter --\n"; $loop_counter++;
   var_dump( is_float($float) );
   var_dump( is_double($float) );
-  var_dump( is_real($float) );
+  var_dump( @is_real($float) );
 }
 
 echo "\n*** Testing is_float(), is_double() & is_real() with non float values ***\n";
@@ -124,7 +124,7 @@ foreach ($not_floats as $value ) {
   echo "--Iteration $loop_counter--\n"; $loop_counter++;
   var_dump( is_float($value) );
   var_dump( is_double($value) );
-  var_dump( is_real($value) );
+  var_dump( @is_real($value) );
 }
 
 echo "\n*** Testing error conditions ***\n";
@@ -426,6 +426,8 @@ bool(false)
 Warning: is_double() expects exactly 1 parameter, 0 given in %s on line %d
 bool(false)
 
+Deprecated: Function is_real() is deprecated in %s on line %d
+
 Warning: is_real() expects exactly 1 parameter, 0 given in %s on line %d
 bool(false)
 
@@ -435,6 +437,8 @@ bool(false)
 Warning: is_double() expects exactly 1 parameter, 2 given in %s on line %d
 bool(false)
 
+Deprecated: Function is_real() is deprecated in %s on line %d
+
 Warning: is_real() expects exactly 1 parameter, 2 given in %s on line %d
 bool(false)
 Done
index 38fc52675f573a691a78c5bb0ea541272e4dd919..be5843a7d51794a53c93494ccbbaec0f6cbbdbf5 100644 (file)
@@ -53,7 +53,7 @@ foreach ($floats as $float ) {
   echo "-- Iteration $loop_counter --\n"; $loop_counter++;
   var_dump( is_float($float) );
   var_dump( is_double($float) );
-  var_dump( is_real($float) );
+  var_dump( @is_real($float) );
 }
 
 echo "\n*** Testing is_float(), is_double() & is_real() with non float values ***\n";
@@ -126,7 +126,7 @@ foreach ($not_floats as $value ) {
   echo "--Iteration $loop_counter--\n"; $loop_counter++;
   var_dump( is_float($value) );
   var_dump( is_double($value) );
-  var_dump( is_real($value) );
+  var_dump( @is_real($value) );
 }
 
 echo "\n*** Testing error conditions ***\n";
@@ -423,6 +423,8 @@ bool(false)
 Warning: is_double() expects exactly 1 parameter, 0 given in %s on line %d
 bool(false)
 
+Deprecated: Function is_real() is deprecated in %s on line %d
+
 Warning: is_real() expects exactly 1 parameter, 0 given in %s on line %d
 bool(false)
 
@@ -432,6 +434,8 @@ bool(false)
 Warning: is_double() expects exactly 1 parameter, 2 given in %s on line %d
 bool(false)
 
+Deprecated: Function is_real() is deprecated in %s on line %d
+
 Warning: is_real() expects exactly 1 parameter, 2 given in %s on line %d
 bool(false)
 Done