Skip to content

Commit 4e19069

Browse files
committed
Deprecate is_real() function
1 parent b1cdf06 commit 4e19069

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Zend/zend_compile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3708,7 +3708,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
37083708
return zend_compile_func_typecheck(result, args, IS_LONG);
37093709
} else if (zend_string_equals_literal(lcname, "is_float")
37103710
|| zend_string_equals_literal(lcname, "is_double")
3711-
|| zend_string_equals_literal(lcname, "is_real")
37123711
) {
37133712
return zend_compile_func_typecheck(result, args, IS_DOUBLE);
37143713
} else if (zend_string_equals_literal(lcname, "is_string")) {

ext/standard/basic_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3109,7 +3109,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
31093109
PHP_FALIAS(is_integer, is_int, arginfo_is_int)
31103110
PHP_FALIAS(is_long, is_int, arginfo_is_int)
31113111
PHP_FALIAS(is_double, is_float, arginfo_is_float)
3112-
PHP_FALIAS(is_real, is_float, arginfo_is_float)
3112+
PHP_DEP_FALIAS(is_real, is_float, arginfo_is_float)
31133113
PHP_FE(is_numeric, arginfo_is_numeric)
31143114
PHP_FE(is_string, arginfo_is_string)
31153115
PHP_FE(is_array, arginfo_is_array)

ext/standard/tests/general_functions/is_float.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ foreach ($floats as $float ) {
5151
echo "-- Iteration $loop_counter --\n"; $loop_counter++;
5252
var_dump( is_float($float) );
5353
var_dump( is_double($float) );
54-
var_dump( is_real($float) );
54+
var_dump( @is_real($float) );
5555
}
5656

5757
echo "\n*** Testing is_float(), is_double() & is_real() with non float values ***\n";
@@ -124,7 +124,7 @@ foreach ($not_floats as $value ) {
124124
echo "--Iteration $loop_counter--\n"; $loop_counter++;
125125
var_dump( is_float($value) );
126126
var_dump( is_double($value) );
127-
var_dump( is_real($value) );
127+
var_dump( @is_real($value) );
128128
}
129129

130130
echo "\n*** Testing error conditions ***\n";
@@ -426,6 +426,8 @@ bool(false)
426426
Warning: is_double() expects exactly 1 parameter, 0 given in %s on line %d
427427
bool(false)
428428

429+
Deprecated: Function is_real() is deprecated in %s on line %d
430+
429431
Warning: is_real() expects exactly 1 parameter, 0 given in %s on line %d
430432
bool(false)
431433

@@ -435,6 +437,8 @@ bool(false)
435437
Warning: is_double() expects exactly 1 parameter, 2 given in %s on line %d
436438
bool(false)
437439

440+
Deprecated: Function is_real() is deprecated in %s on line %d
441+
438442
Warning: is_real() expects exactly 1 parameter, 2 given in %s on line %d
439443
bool(false)
440444
Done

ext/standard/tests/general_functions/is_float_64bit.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ foreach ($floats as $float ) {
5353
echo "-- Iteration $loop_counter --\n"; $loop_counter++;
5454
var_dump( is_float($float) );
5555
var_dump( is_double($float) );
56-
var_dump( is_real($float) );
56+
var_dump( @is_real($float) );
5757
}
5858

5959
echo "\n*** Testing is_float(), is_double() & is_real() with non float values ***\n";
@@ -126,7 +126,7 @@ foreach ($not_floats as $value ) {
126126
echo "--Iteration $loop_counter--\n"; $loop_counter++;
127127
var_dump( is_float($value) );
128128
var_dump( is_double($value) );
129-
var_dump( is_real($value) );
129+
var_dump( @is_real($value) );
130130
}
131131

132132
echo "\n*** Testing error conditions ***\n";
@@ -423,6 +423,8 @@ bool(false)
423423
Warning: is_double() expects exactly 1 parameter, 0 given in %s on line %d
424424
bool(false)
425425

426+
Deprecated: Function is_real() is deprecated in %s on line %d
427+
426428
Warning: is_real() expects exactly 1 parameter, 0 given in %s on line %d
427429
bool(false)
428430

@@ -432,6 +434,8 @@ bool(false)
432434
Warning: is_double() expects exactly 1 parameter, 2 given in %s on line %d
433435
bool(false)
434436

437+
Deprecated: Function is_real() is deprecated in %s on line %d
438+
435439
Warning: is_real() expects exactly 1 parameter, 2 given in %s on line %d
436440
bool(false)
437441
Done

0 commit comments

Comments
 (0)