Commit 0b14af3b980 for php.net
commit 0b14af3b980ba5f4b3a027c9f8418f6eee092c13
Author: Gina Peter Banyard <girgias@php.net>
Date: Wed Aug 5 17:23:27 2026 +0100
standard: deprecate aliases with non canonical type name
Fix tests using non canonical versions and improve existing tests.
RFC:
- https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_is_double
- https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_is_integer
- https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_is_long
- https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_doubleval
diff --git a/Zend/tests/type_declarations/union_types/incdec_prop.phpt b/Zend/tests/type_declarations/union_types/incdec_prop.phpt
index dde6f595264..7b61fc9fe60 100644
--- a/Zend/tests/type_declarations/union_types/incdec_prop.phpt
+++ b/Zend/tests/type_declarations/union_types/incdec_prop.phpt
@@ -13,40 +13,40 @@ class Test {
$test = new Test;
$test->prop = PHP_INT_MAX;
$x = $test->prop++;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test->prop = PHP_INT_MAX;
$x = ++$test->prop;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test->prop = PHP_INT_MIN;
$x = $test->prop--;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test->prop = PHP_INT_MIN;
$x = --$test->prop;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test = new Test;
$test->prop = PHP_INT_MAX;
$r =& $test->prop;
$x = $test->prop++;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test->prop = PHP_INT_MAX;
$x = ++$test->prop;
$r =& $test->prop;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test->prop = PHP_INT_MIN;
$x = $test->prop--;
$r =& $test->prop;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
$test->prop = PHP_INT_MIN;
$x = --$test->prop;
$r =& $test->prop;
-var_dump(is_double($test->prop));
+var_dump(is_float($test->prop));
/* Incrementing a non-int|float property past int min/max is an error,
* even if the result of the overflow (a float) would technically be allowed
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 92807513bc6..cac60319a0a 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5387,14 +5387,9 @@ static zend_result zend_try_compile_special_func_ex(znode *result, zend_string *
return zend_compile_func_typecheck(result, args, IS_NULL);
} else if (zend_string_equals_literal(lcname, "is_bool")) {
return zend_compile_func_typecheck(result, args, _IS_BOOL);
- } else if (zend_string_equals_literal(lcname, "is_long")
- || zend_string_equals_literal(lcname, "is_int")
- || zend_string_equals_literal(lcname, "is_integer")
- ) {
+ } else if (zend_string_equals_literal(lcname, "is_int")) {
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")
- ) {
+ } else if (zend_string_equals_literal(lcname, "is_float")) {
return zend_compile_func_typecheck(result, args, IS_DOUBLE);
} else if (zend_string_equals_literal(lcname, "is_string")) {
return zend_compile_func_typecheck(result, args, IS_STRING);
@@ -5410,9 +5405,7 @@ static zend_result zend_try_compile_special_func_ex(znode *result, zend_string *
return zend_compile_func_cast(result, args, _IS_BOOL);
} else if (zend_string_equals_literal(lcname, "intval")) {
return zend_compile_func_cast(result, args, IS_LONG);
- } else if (zend_string_equals_literal(lcname, "floatval")
- || zend_string_equals_literal(lcname, "doubleval")
- ) {
+ } else if (zend_string_equals_literal(lcname, "floatval")) {
return zend_compile_func_cast(result, args, IS_DOUBLE);
} else if (zend_string_equals_literal(lcname, "strval")) {
return zend_compile_func_cast(result, args, IS_STRING);
diff --git a/ext/date/tests/strtotime-mysql-64bit.phpt b/ext/date/tests/strtotime-mysql-64bit.phpt
index ddf1dfff3fd..ddc270cb9b1 100644
--- a/ext/date/tests/strtotime-mysql-64bit.phpt
+++ b/ext/date/tests/strtotime-mysql-64bit.phpt
@@ -14,7 +14,7 @@
foreach($d as $date) {
$time = strtotime($date);
- if (is_integer($time)) {
+ if (is_int($time)) {
var_dump(date('r', $time));
} else {
var_dump($time);
diff --git a/ext/date/tests/strtotime-mysql.phpt b/ext/date/tests/strtotime-mysql.phpt
index c51f63f1323..629165aa873 100644
--- a/ext/date/tests/strtotime-mysql.phpt
+++ b/ext/date/tests/strtotime-mysql.phpt
@@ -14,7 +14,7 @@
foreach($d as $date) {
$time = strtotime($date);
- if (is_integer($time)) {
+ if (is_int($time)) {
var_dump(date('r', $time));
} else {
var_dump($time);
diff --git a/ext/date/tests/strtotime3-64bit.phpt b/ext/date/tests/strtotime3-64bit.phpt
index c4f87c3b1a6..d9dff3bc484 100644
--- a/ext/date/tests/strtotime3-64bit.phpt
+++ b/ext/date/tests/strtotime3-64bit.phpt
@@ -36,7 +36,7 @@
foreach ($strs as $str) {
$t = strtotime($str, $time);
- if (is_integer($t)) {
+ if (is_int($t)) {
var_dump(date(DATE_RFC2822, $t));
} else {
var_dump($t);
diff --git a/ext/date/tests/strtotime3.phpt b/ext/date/tests/strtotime3.phpt
index 763b77a07da..c96e07ca26e 100644
--- a/ext/date/tests/strtotime3.phpt
+++ b/ext/date/tests/strtotime3.phpt
@@ -36,7 +36,7 @@
foreach ($strs as $str) {
$t = strtotime($str, $time);
- if (is_integer($t)) {
+ if (is_int($t)) {
var_dump(date(DATE_RFC2822, $t));
} else {
var_dump($t);
diff --git a/ext/filter/tests/046.phpt b/ext/filter/tests/046.phpt
index 295369e56f5..ee95f5494ed 100644
--- a/ext/filter/tests/046.phpt
+++ b/ext/filter/tests/046.phpt
@@ -24,7 +24,7 @@
function test_validation($val, $msg) {
$f = filter_var($val, FILTER_VALIDATE_INT);
echo "$msg filtered: "; var_dump($f); // filtered value (or false)
- echo "$msg is_long: "; var_dump(is_long($f)); // test validation
+ echo "$msg is_int: "; var_dump(is_int($f)); // test validation
echo "$msg equal: "; var_dump($val == $f); // test equality of result
}
@@ -36,14 +36,14 @@ function test_validation($val, $msg) {
?>
--EXPECTF--
max filtered: int(%d)
-max is_long: bool(true)
+max is_int: bool(true)
max equal: bool(true)
overflow filtered: bool(false)
-overflow is_long: bool(false)
+overflow is_int: bool(false)
overflow equal: bool(false)
min filtered: int(-%d)
-min is_long: bool(true)
+min is_int: bool(true)
min equal: bool(true)
underflow filtered: bool(false)
-underflow is_long: bool(false)
+underflow is_int: bool(false)
underflow equal: bool(false)
diff --git a/ext/filter/tests/047.phpt b/ext/filter/tests/047.phpt
index 763b64e837e..76471e82762 100644
--- a/ext/filter/tests/047.phpt
+++ b/ext/filter/tests/047.phpt
@@ -19,13 +19,13 @@ function octal_inc($s) {
$s = sprintf("%o", PHP_INT_MAX);
-var_dump(is_long(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
+var_dump(is_int(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
$s = octal_inc($s);
-var_dump(is_long(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
+var_dump(is_int(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
$s = sprintf("%o", ~0);
-var_dump(is_long(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
+var_dump(is_int(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
$s = octal_inc($s);
var_dump(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
diff --git a/ext/filter/tests/048.phpt b/ext/filter/tests/048.phpt
index 7191726e3c9..a46d4545599 100644
--- a/ext/filter/tests/048.phpt
+++ b/ext/filter/tests/048.phpt
@@ -23,13 +23,13 @@ function hex_inc($s) {
$s = sprintf("%x", PHP_INT_MAX);
-var_dump(is_long(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
+var_dump(is_int(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
$s = hex_inc($s);
-var_dump(is_long(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
+var_dump(is_int(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
$s = sprintf("%x", ~0);
-var_dump(is_long(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
+var_dump(is_int(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
$s = hex_inc($s);
var_dump(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
diff --git a/ext/pgsql/tests/20pg_get_pid.phpt b/ext/pgsql/tests/20pg_get_pid.phpt
index 3cad32c838f..5416afb476f 100644
--- a/ext/pgsql/tests/20pg_get_pid.phpt
+++ b/ext/pgsql/tests/20pg_get_pid.phpt
@@ -13,7 +13,7 @@
$db = pg_connect($conn_str);
$pid = pg_get_pid($db);
-is_integer($pid) ? print 'OK' : print 'NG';
+is_int($pid) ? print 'OK' : print 'NG';
?>
--EXPECT--
OK
diff --git a/ext/posix/tests/posix_getsid.phpt b/ext/posix/tests/posix_getsid.phpt
index fbf045711f9..fde7e237d69 100644
--- a/ext/posix/tests/posix_getsid.phpt
+++ b/ext/posix/tests/posix_getsid.phpt
@@ -14,7 +14,7 @@
$pid = posix_getpid();
echo "\n-- Testing posix_getsid() function with current process pid --\n";
-var_dump( is_long(posix_getsid($pid)) );
+var_dump( is_int(posix_getsid($pid)) );
?>
--EXPECT--
diff --git a/ext/spl/tests/regexiterator_getpregflags.phpt b/ext/spl/tests/regexiterator_getpregflags.phpt
index 2fe492aebeb..7e58dd47b41 100644
--- a/ext/spl/tests/regexiterator_getpregflags.phpt
+++ b/ext/spl/tests/regexiterator_getpregflags.phpt
@@ -26,8 +26,8 @@ class TestRegexIterator extends RegexIterator{}
$r->setPregFlags(PREG_OFFSET_CAPTURE);
-echo is_long($r->getPregFlags());
+var_dump(is_int($r->getPregFlags()));
?>
--EXPECT--
-1
+bool(true)
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index 07e61957d19..ae3c9065cb1 100644
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -3634,6 +3634,7 @@ function intval(mixed $value, int $base = 10): int {}
function floatval(mixed $value): float {}
/** @alias floatval */
+#[\Deprecated(message: "use floatval() instead", since: "8.6")]
function doubleval(mixed $value): float {}
/**
@@ -3667,9 +3668,11 @@ function is_bool(mixed $value): bool {}
function is_int(mixed $value): bool {}
/** @alias is_int */
+#[\Deprecated(message: "use is_int() instead", since: "8.6")]
function is_integer(mixed $value): bool {}
/** @alias is_int */
+#[\Deprecated(message: "use is_int() instead", since: "8.6")]
function is_long(mixed $value): bool {}
/**
@@ -3678,6 +3681,7 @@ function is_long(mixed $value): bool {}
function is_float(mixed $value): bool {}
/** @alias is_float */
+#[\Deprecated(message: "use is_float() instead", since: "8.6")]
function is_double(mixed $value): bool {}
/**
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index d24de1fef99..91e1cb53276 100644
Binary files a/ext/standard/basic_functions_arginfo.h and b/ext/standard/basic_functions_arginfo.h differ
diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h
index 97d896e8bb6..ac1e9843da2 100644
Binary files a/ext/standard/basic_functions_decl.h and b/ext/standard/basic_functions_decl.h differ
diff --git a/ext/standard/tests/general_functions/doubleval.phpt b/ext/standard/tests/general_functions/doubleval.phpt
new file mode 100644
index 00000000000..a3e083501fb
--- /dev/null
+++ b/ext/standard/tests/general_functions/doubleval.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Deprecated doubleval() alias
+--INI--
+precision = 14
+--FILE--
+<?php
+
+$values = [
+ null,
+ false,
+ true,
+ 10,
+ "string",
+ [],
+ STDOUT,
+ new stdClass(),
+];
+
+foreach ($values as $val) {
+ var_dump(doubleval($val) === floatval($val));
+}
+?>
+--EXPECTF--
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+bool(true)
+
+Deprecated: Function doubleval() is deprecated since 8.6, use floatval() instead in %s on line %d
+
+Warning: Object of class stdClass could not be converted to float in %s on line %d
+
+Warning: Object of class stdClass could not be converted to float in %s on line %d
+bool(true)
diff --git a/ext/standard/tests/general_functions/floatval.phpt b/ext/standard/tests/general_functions/floatval.phpt
deleted file mode 100644
index 9ff49bb0108..00000000000
--- a/ext/standard/tests/general_functions/floatval.phpt
+++ /dev/null
@@ -1,171 +0,0 @@
---TEST--
-Testing floatval() and its alias doubleval() Functions
---FILE--
-<?php
-echo "*** Testing floatval() with valid float values ***\n";
-// different valid float values
-$valid_floats = array(
- 0.0,
- 1.0,
- -1.0,
- 1.234,
- -1.234,
- 1.2e3,
- -1.2e3,
- 10.0000000000000000005,
- 10.5e+5,
- 1e5,
- -1e5,
- 1e-5,
- -1e-1,
- 1e+5,
- -1e+5,
- 1E5,
- -1E5,
- 1E+5,
- -1E+5,
- .5e+7,
- -.5e+7
-);
-
-/* loop to check that floatval() recognizes different
- float values, expected output:float value for valid floating point number */
-
-foreach ($valid_floats as $value ) {
- var_dump( floatval($value) );
-}
-
-
-echo "\n*** Testing doubleval() with valid float values ***\n";
-/* loop to check that doubleval() also recognizes different
- float values, expected output:float value for valid floating point number */
-
-foreach ($valid_floats as $value ) {
- var_dump( doubleval($value) );
-}
-
-
-echo "\n*** Testing floatval() on non floating types ***\n";
-
-// other types in an array
-$not_float_types = array (
- -2147483648, // max negative integer value
- 2147483648, // max positive integer value
- STDERR, // resource
- "0.0", // string
- "1.0",
- "-1.3e3",
- "bob-1.3e3",
- "10 Some dollars",
- "10.2 Some Dollars",
- "10.0 dollar" + 1,
- "10.0 dollar" + 1.0,
- "",
- true,
- NULL,
- null,
- );
-/* loop through the $not_float_types to see working of
- floatval() on non float types, expected output: float value valid floating point numbers */
-foreach ($not_float_types as $type ) {
- var_dump( floatval($type) );
-}
-
-
-echo "\n*** Testing doubleval() on non floating types ***\n";
-
-/* loop through the $not_float_types to see working of
- doubleval() on non float types, expected output: float value valid floating point numbers */
-foreach ($not_float_types as $type ) {
- var_dump( doubleval($type) );
-}
-
-echo "\nDone\n";
-
-?>
---EXPECTF--
-*** Testing floatval() with valid float values ***
-float(0)
-float(1)
-float(-1)
-float(1.234)
-float(-1.234)
-float(1200)
-float(-1200)
-float(10)
-float(1050000)
-float(100000)
-float(-100000)
-float(1.0E-5)
-float(-0.1)
-float(100000)
-float(-100000)
-float(100000)
-float(-100000)
-float(100000)
-float(-100000)
-float(5000000)
-float(-5000000)
-
-*** Testing doubleval() with valid float values ***
-float(0)
-float(1)
-float(-1)
-float(1.234)
-float(-1.234)
-float(1200)
-float(-1200)
-float(10)
-float(1050000)
-float(100000)
-float(-100000)
-float(1.0E-5)
-float(-0.1)
-float(100000)
-float(-100000)
-float(100000)
-float(-100000)
-float(100000)
-float(-100000)
-float(5000000)
-float(-5000000)
-
-*** Testing floatval() on non floating types ***
-
-Warning: A non-numeric value encountered in %s on line %d
-
-Warning: A non-numeric value encountered in %s on line %d
-float(-2147483648)
-float(2147483648)
-float(3)
-float(0)
-float(1)
-float(-1300)
-float(0)
-float(10)
-float(10.2)
-float(11)
-float(11)
-float(0)
-float(1)
-float(0)
-float(0)
-
-*** Testing doubleval() on non floating types ***
-float(-2147483648)
-float(2147483648)
-float(3)
-float(0)
-float(1)
-float(-1300)
-float(0)
-float(10)
-float(10.2)
-float(11)
-float(11)
-float(0)
-float(1)
-float(0)
-float(0)
-
-Done
diff --git a/ext/standard/tests/general_functions/floatval_basic.phpt b/ext/standard/tests/general_functions/floatval_basic.phpt
index d20d4dedfaa..c6de09853c2 100644
--- a/ext/standard/tests/general_functions/floatval_basic.phpt
+++ b/ext/standard/tests/general_functions/floatval_basic.phpt
@@ -1,33 +1,33 @@
--TEST--
-Testing floatval() and its alias doubleval() Functions
+Testing floatval() with floats
--INI--
-precision = 14
+precision=14
--FILE--
<?php
// different valid float values
-$valid_floats = array(
- "0.0" => 0.0,
- "1.0" => 1.0,
- "-1.0" => -1.0,
- "1.234" => 1.234,
- "-1.234" => -1.234,
- "1.2e3" => 1.2e3,
- "-1.2e3" => -1.2e3,
- "10.0000000000000000005" => 10.0000000000000000005,
- "10.5e+5" => 10.5e+5,
- "1e5" => 1e5,
- "-1e5" => -1e5,
- "1e5" => 1e-5,
- "-1e-1" => -1e-1,
- "1e+5" => 1e+5,
- "-1e+5" =>-1e+5,
- "1E5" => 1E5,
- "-1E5" => -1E5,
- "1E+5" => 1E+5,
- "-1E5" => -1E+5,
- ".5e+7" => .5e+7,
- "-.5e+7" =>-.5e+7
-);
+$valid_floats = [
+ "0.0" => 0.0,
+ "1.0" => 1.0,
+ "-1.0" => -1.0,
+ "1.234" => 1.234,
+ "-1.234" => -1.234,
+ "1.2e3" => 1.2e3,
+ "-1.2e3" => -1.2e3,
+ "10.0000000000000000005" => 10.0000000000000000005,
+ "10.5e+5" => 10.5e+5,
+ "1e5" => 1e5,
+ "-1e5" => -1e5,
+ "1e5" => 1e-5,
+ "-1e-1" => -1e-1,
+ "1e+5" => 1e+5,
+ "-1e+5" =>-1e+5,
+ "1E5" => 1E5,
+ "-1E5" => -1E5,
+ "1E+5" => 1E+5,
+ "-1E5" => -1E+5,
+ ".5e+7" => .5e+7,
+ "-.5e+7" =>-.5e+7
+];
/* loop to check that floatval() recognizes different
float values, expected output:float value for valid floating point number */
@@ -37,14 +37,6 @@
var_dump( floatval($value) );
}
-/* loop to check that doubleval() also recognizes different
- float values, expected output:float value for valid floating point number */
-echo "\n*** Testing doubleval() with valid float values ***\n";
-foreach ($valid_floats as $key => $value ) {
- echo "\n-- Iteration : $key -- \n";
- var_dump( doubleval($value) );
-}
-
?>
--EXPECT--
*** Testing floatval() with valid float values ***
@@ -105,62 +97,3 @@
-- Iteration : -.5e+7 --
float(-5000000)
-
-*** Testing doubleval() with valid float values ***
-
--- Iteration : 0.0 --
-float(0)
-
--- Iteration : 1.0 --
-float(1)
-
--- Iteration : -1.0 --
-float(-1)
-
--- Iteration : 1.234 --
-float(1.234)
-
--- Iteration : -1.234 --
-float(-1.234)
-
--- Iteration : 1.2e3 --
-float(1200)
-
--- Iteration : -1.2e3 --
-float(-1200)
-
--- Iteration : 10.0000000000000000005 --
-float(10)
-
--- Iteration : 10.5e+5 --
-float(1050000)
-
--- Iteration : 1e5 --
-float(1.0E-5)
-
--- Iteration : -1e5 --
-float(-100000)
-
--- Iteration : -1e-1 --
-float(-0.1)
-
--- Iteration : 1e+5 --
-float(100000)
-
--- Iteration : -1e+5 --
-float(-100000)
-
--- Iteration : 1E5 --
-float(100000)
-
--- Iteration : -1E5 --
-float(-100000)
-
--- Iteration : 1E+5 --
-float(100000)
-
--- Iteration : .5e+7 --
-float(5000000)
-
--- Iteration : -.5e+7 --
-float(-5000000)
diff --git a/ext/standard/tests/general_functions/floatval_variation1.phpt b/ext/standard/tests/general_functions/floatval_variation1.phpt
index 032d089b01c..1759691aa21 100644
--- a/ext/standard/tests/general_functions/floatval_variation1.phpt
+++ b/ext/standard/tests/general_functions/floatval_variation1.phpt
@@ -1,25 +1,28 @@
--TEST--
-Testing floatval() and its alias doubleval() functions : usage variations - different data types as $y arg
+Testing floatval() different data types as arg
+--INI--
+precision=14
--FILE--
<?php
// other types in an array
-$not_float_types = array (
- "-2147483648" => -2147483648, // max negative integer value
- "2147483647" => 2147483648, // max positive integer value
- "stream resource" => STDERR,
- "\"0.0\"" => "0.0", // string
- "\"1.0\"" => "1.0",
- "\"-1.3e3\"" => "-1.3e3",
- "\"bob-1.3e3\"" => "bob-1.3e3",
- "\"10 Some dollars\"" => "10 Some dollars",
- "\"10.2 Some Dollars\"" => "10.2 Some Dollars",
- "\"10.0 dollar\" + 1" => "10.0 dollar" + 1,
- "\"10.0 dollar\" + 1.0" => "10.0 dollar" + 1.0,
- "\"\"" => "",
- "true" => true,
- "null" => null,
- );
+$not_float_types = [
+ "-2147483648" => -2147483648, // max negative integer value
+ "2147483647" => 2147483648, // max positive integer value
+ "stream resource" => STDERR,
+ "\"0.0\"" => "0.0", // string
+ "\"1.0\"" => "1.0",
+ "\"-1.3e3\"" => "-1.3e3",
+ "\"bob-1.3e3\"" => "bob-1.3e3",
+ "\"10 Some dollars\"" => "10 Some dollars",
+ "\"10.2 Some Dollars\"" => "10.2 Some Dollars",
+ "\"10.0 dollar\" + 1" => "10.0 dollar" + 1,
+ "\"10.0 dollar\" + 1.0" => "10.0 dollar" + 1.0,
+ "\"\"" => "",
+ "true" => true,
+ "false" => false,
+ "null" => null,
+];
/* loop through the $not_float_types to see working of
floatval() on non float types, expected output: float value valid floating point numbers */
echo "\n*** Testing floatval() on non floating types ***\n";
@@ -28,14 +31,6 @@
var_dump( floatval($type) );
}
-echo "\n*** Testing doubleval() on non floating types ***\n";
-
-/* loop through the $not_float_types to see working of
- doubleval() on non float types, expected output: float value valid floating point numbers */
-foreach ($not_float_types as $key => $type ) {
- echo "\n-- Iteration : $key --\n";
- var_dump( doubleval($type) );
-}
?>
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d
@@ -83,49 +78,8 @@
-- Iteration : true --
float(1)
--- Iteration : null --
-float(0)
-
-*** Testing doubleval() on non floating types ***
-
--- Iteration : -2147483648 --
-float(-2147483648)
-
--- Iteration : 2147483647 --
-float(2147483648)
-
--- Iteration : stream resource --
-float(3)
-
--- Iteration : "0.0" --
-float(0)
-
--- Iteration : "1.0" --
-float(1)
-
--- Iteration : "-1.3e3" --
-float(-1300)
-
--- Iteration : "bob-1.3e3" --
+-- Iteration : false --
float(0)
--- Iteration : "10 Some dollars" --
-float(10)
-
--- Iteration : "10.2 Some Dollars" --
-float(10.2)
-
--- Iteration : "10.0 dollar" + 1 --
-float(11)
-
--- Iteration : "10.0 dollar" + 1.0 --
-float(11)
-
--- Iteration : "" --
-float(0)
-
--- Iteration : true --
-float(1)
-
-- Iteration : null --
float(0)
diff --git a/ext/standard/tests/general_functions/is_float.phpt b/ext/standard/tests/general_functions/is_float.phpt
index e951ebe633c..38e08cb19c0 100644
--- a/ext/standard/tests/general_functions/is_float.phpt
+++ b/ext/standard/tests/general_functions/is_float.phpt
@@ -1,20 +1,12 @@
--TEST--
-Test is_float() & its is_double() alias
---SKIPIF--
-<?php
-if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
-?>
+Test is_float()
--FILE--
<?php
-echo "*** Testing is_float(), is_double() with float values***\n";
-// different valid float values
-$floats = array(
- -2147483649, // float value
- 2147483648, // float value
- -0x80000001, // float value, beyond max negative int
- 0x800000001, // float value, beyond max positive int
- 020000000001, // float value, beyond max positive int
- -020000000001, // float value, beyond max negative int
+
+// different valid float values
+$floats = [
+ PHP_INT_MIN -1,
+ PHP_INT_MAX +1,
0.0,
-0.1,
10.0000000000000000005,
@@ -38,66 +30,31 @@
.05E+44,
-.05E+44,
.0034E-30,
- -.0034E-30
-);
-/* loop to check that is_float(), is_double() & recognizes
- different float values, expected: bool(true) */
-$loop_counter = 1;
+ -.0034E-30,
+];
+
foreach ($floats as $float ) {
- echo "-- Iteration $loop_counter --\n"; $loop_counter++;
- var_dump( is_float($float) );
- var_dump( is_double($float) );
+ if (!is_float($float)) {
+ echo "Value $float should be a float!\n";
+ }
}
-echo "\n*** Testing is_float(), is_double() with non float values ***\n";
-// get a resource type variable
-$fp = fopen (__FILE__, "r");
-$dfp = opendir ( __DIR__ );
-
-// unset variable
-$unset_var = 10;
-unset ($unset_var);
-
-// non_scalar values, objects, arrays, resources and boolean
-class foo
-{
- var $array = array(10.5);
-};
-$object = new foo();
-
-$not_floats = array (
- new foo, //object
- $object,
+// null, bool, int, objects, arrays, and resources
- $fp, // resource
- $dfp,
-
- array(), // arrays
+$not_floats = [
+ new stdClass(),
+ STDOUT,
+ array(),
array(NULL),
- array(0.5e10),
- array(1,2,3,4),
- array("string"),
-
- NULL, // nulls
null,
-
true, // boolean
- TRUE,
false,
- FALSE,
-
- "", // strings
'',
- "0",
'0',
- "0.0",
'0.0',
'0.5',
- "-0.5",
- "1e5",
'1e5',
'1.5e6_string',
- "1.5e6_string",
1, // integers, hex and octal
-1,
@@ -107,230 +64,16 @@ class foo
-0x673,
0123,
-0123,
+];
- @$unset_var, // unset variable
- @$undefined_var
-);
-/* loop through the $not_floats to see working of
- is_float(), is_double() on objects,
- arrays, boolean and others */
-$loop_counter = 1;
foreach ($not_floats as $value ) {
- echo "--Iteration $loop_counter--\n"; $loop_counter++;
- var_dump( is_float($value) );
- var_dump( is_double($value) );
+ if (is_float($value)) {
+ echo "Value $value should not be a float!\n";
+ }
}
echo "Done\n";
-// close the resources used
-fclose($fp);
-closedir($dfp);
-
?>
--EXPECT--
-*** Testing is_float(), is_double() with float values***
--- Iteration 1 --
-bool(true)
-bool(true)
--- Iteration 2 --
-bool(true)
-bool(true)
--- Iteration 3 --
-bool(true)
-bool(true)
--- Iteration 4 --
-bool(true)
-bool(true)
--- Iteration 5 --
-bool(true)
-bool(true)
--- Iteration 6 --
-bool(true)
-bool(true)
--- Iteration 7 --
-bool(true)
-bool(true)
--- Iteration 8 --
-bool(true)
-bool(true)
--- Iteration 9 --
-bool(true)
-bool(true)
--- Iteration 10 --
-bool(true)
-bool(true)
--- Iteration 11 --
-bool(true)
-bool(true)
--- Iteration 12 --
-bool(true)
-bool(true)
--- Iteration 13 --
-bool(true)
-bool(true)
--- Iteration 14 --
-bool(true)
-bool(true)
--- Iteration 15 --
-bool(true)
-bool(true)
--- Iteration 16 --
-bool(true)
-bool(true)
--- Iteration 17 --
-bool(true)
-bool(true)
--- Iteration 18 --
-bool(true)
-bool(true)
--- Iteration 19 --
-bool(true)
-bool(true)
--- Iteration 20 --
-bool(true)
-bool(true)
--- Iteration 21 --
-bool(true)
-bool(true)
--- Iteration 22 --
-bool(true)
-bool(true)
--- Iteration 23 --
-bool(true)
-bool(true)
--- Iteration 24 --
-bool(true)
-bool(true)
--- Iteration 25 --
-bool(true)
-bool(true)
--- Iteration 26 --
-bool(true)
-bool(true)
--- Iteration 27 --
-bool(true)
-bool(true)
--- Iteration 28 --
-bool(true)
-bool(true)
--- Iteration 29 --
-bool(true)
-bool(true)
--- Iteration 30 --
-bool(true)
-bool(true)
-
-*** Testing is_float(), is_double() with non float values ***
---Iteration 1--
-bool(false)
-bool(false)
---Iteration 2--
-bool(false)
-bool(false)
---Iteration 3--
-bool(false)
-bool(false)
---Iteration 4--
-bool(false)
-bool(false)
---Iteration 5--
-bool(false)
-bool(false)
---Iteration 6--
-bool(false)
-bool(false)
---Iteration 7--
-bool(false)
-bool(false)
---Iteration 8--
-bool(false)
-bool(false)
---Iteration 9--
-bool(false)
-bool(false)
---Iteration 10--
-bool(false)
-bool(false)
---Iteration 11--
-bool(false)
-bool(false)
---Iteration 12--
-bool(false)
-bool(false)
---Iteration 13--
-bool(false)
-bool(false)
---Iteration 14--
-bool(false)
-bool(false)
---Iteration 15--
-bool(false)
-bool(false)
---Iteration 16--
-bool(false)
-bool(false)
---Iteration 17--
-bool(false)
-bool(false)
---Iteration 18--
-bool(false)
-bool(false)
---Iteration 19--
-bool(false)
-bool(false)
---Iteration 20--
-bool(false)
-bool(false)
---Iteration 21--
-bool(false)
-bool(false)
---Iteration 22--
-bool(false)
-bool(false)
---Iteration 23--
-bool(false)
-bool(false)
---Iteration 24--
-bool(false)
-bool(false)
---Iteration 25--
-bool(false)
-bool(false)
---Iteration 26--
-bool(false)
-bool(false)
---Iteration 27--
-bool(false)
-bool(false)
---Iteration 28--
-bool(false)
-bool(false)
---Iteration 29--
-bool(false)
-bool(false)
---Iteration 30--
-bool(false)
-bool(false)
---Iteration 31--
-bool(false)
-bool(false)
---Iteration 32--
-bool(false)
-bool(false)
---Iteration 33--
-bool(false)
-bool(false)
---Iteration 34--
-bool(false)
-bool(false)
---Iteration 35--
-bool(false)
-bool(false)
---Iteration 36--
-bool(false)
-bool(false)
---Iteration 37--
-bool(false)
-bool(false)
Done
diff --git a/ext/standard/tests/general_functions/is_float_64bit.phpt b/ext/standard/tests/general_functions/is_float_64bit.phpt
deleted file mode 100644
index 93fcc0949bb..00000000000
--- a/ext/standard/tests/general_functions/is_float_64bit.phpt
+++ /dev/null
@@ -1,333 +0,0 @@
---TEST--
-Test is_float() & its is_double() alias
---SKIPIF--
-<?php
-if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
-?>
---INI--
-precision=14
---FILE--
-<?php
-echo "*** Testing is_float(), is_double() with float values***\n";
-// different valid float values
-$floats = array(
- -2147483649, // float value
- 2147483648, // float value
- -0x80000001, // float value, beyond max negative int
- 0x800000001, // float value, beyond max positive int
- 020000000001, // float value, beyond max positive int
- -020000000001, // float value, beyond max negative int
- 0.0,
- -0.1,
- 10.0000000000000000005,
- 10.5e+5,
- 1e5,
- -1e5,
- 1e-5,
- -1e-5,
- 1e+5,
- -1e+5,
- 1E5,
- -1E5,
- 1E+5,
- -1E+5,
- 1E-5,
- -1E-5,
- .5e+7,
- -.5e+7,
- .6e-19,
- -.6e-19,
- .05E+44,
- -.05E+44,
- .0034E-30,
- -.0034E-30
-);
-/* loop to check that is_float(), is_double() recognizes
- different float values, expected: bool(true) */
-$loop_counter = 1;
-foreach ($floats as $float ) {
- echo "-- Iteration $loop_counter --\n"; $loop_counter++;
- var_dump( is_float($float) );
- var_dump( is_double($float) );
-}
-
-echo "\n*** Testing is_float(), is_double() with non float values ***\n";
-// get a resource type variable
-$fp = fopen (__FILE__, "r");
-$dfp = opendir ( __DIR__ );
-
-// unset variable
-$unset_var = 10;
-unset ($unset_var);
-
-// non_scalar values, objects, arrays, resources and boolean
-class foo
-{
- var $array = array(10.5);
-};
-$object = new foo();
-
-$not_floats = array (
- new foo, //object
- $object,
-
- $fp, // resource
- $dfp,
-
- array(), // arrays
- array(NULL),
- array(0.5e10),
- array(1,2,3,4),
- array("string"),
-
- NULL, // nulls
- null,
-
- true, // boolean
- TRUE,
- false,
- FALSE,
-
- "", // strings
- '',
- "0",
- '0',
- "0.0",
- '0.0',
- '0.5',
- "-0.5",
- "1e5",
- '1e5',
- '1.5e6_string',
- "1.5e6_string",
-
- 1, // integers, hex and octal
- -1,
- 0,
- 12345,
- 0xFF55,
- -0x673,
- 0123,
- -0123,
-
- @$unset_var, // unset variable
- @$undefined_var
-);
-/* loop through the $not_floats to see working of
- is_float(), is_double() on objects,
- arrays, boolean and others */
-$loop_counter = 1;
-foreach ($not_floats as $value ) {
- echo "--Iteration $loop_counter--\n"; $loop_counter++;
- var_dump( is_float($value) );
- var_dump( is_double($value) );
-}
-
-echo "Done\n";
-?>
---EXPECT--
-*** Testing is_float(), is_double() with float values***
--- Iteration 1 --
-bool(false)
-bool(false)
--- Iteration 2 --
-bool(false)
-bool(false)
--- Iteration 3 --
-bool(false)
-bool(false)
--- Iteration 4 --
-bool(false)
-bool(false)
--- Iteration 5 --
-bool(false)
-bool(false)
--- Iteration 6 --
-bool(false)
-bool(false)
--- Iteration 7 --
-bool(true)
-bool(true)
--- Iteration 8 --
-bool(true)
-bool(true)
--- Iteration 9 --
-bool(true)
-bool(true)
--- Iteration 10 --
-bool(true)
-bool(true)
--- Iteration 11 --
-bool(true)
-bool(true)
--- Iteration 12 --
-bool(true)
-bool(true)
--- Iteration 13 --
-bool(true)
-bool(true)
--- Iteration 14 --
-bool(true)
-bool(true)
--- Iteration 15 --
-bool(true)
-bool(true)
--- Iteration 16 --
-bool(true)
-bool(true)
--- Iteration 17 --
-bool(true)
-bool(true)
--- Iteration 18 --
-bool(true)
-bool(true)
--- Iteration 19 --
-bool(true)
-bool(true)
--- Iteration 20 --
-bool(true)
-bool(true)
--- Iteration 21 --
-bool(true)
-bool(true)
--- Iteration 22 --
-bool(true)
-bool(true)
--- Iteration 23 --
-bool(true)
-bool(true)
--- Iteration 24 --
-bool(true)
-bool(true)
--- Iteration 25 --
-bool(true)
-bool(true)
--- Iteration 26 --
-bool(true)
-bool(true)
--- Iteration 27 --
-bool(true)
-bool(true)
--- Iteration 28 --
-bool(true)
-bool(true)
--- Iteration 29 --
-bool(true)
-bool(true)
--- Iteration 30 --
-bool(true)
-bool(true)
-
-*** Testing is_float(), is_double() with non float values ***
---Iteration 1--
-bool(false)
-bool(false)
---Iteration 2--
-bool(false)
-bool(false)
---Iteration 3--
-bool(false)
-bool(false)
---Iteration 4--
-bool(false)
-bool(false)
---Iteration 5--
-bool(false)
-bool(false)
---Iteration 6--
-bool(false)
-bool(false)
---Iteration 7--
-bool(false)
-bool(false)
---Iteration 8--
-bool(false)
-bool(false)
---Iteration 9--
-bool(false)
-bool(false)
---Iteration 10--
-bool(false)
-bool(false)
---Iteration 11--
-bool(false)
-bool(false)
---Iteration 12--
-bool(false)
-bool(false)
---Iteration 13--
-bool(false)
-bool(false)
---Iteration 14--
-bool(false)
-bool(false)
---Iteration 15--
-bool(false)
-bool(false)
---Iteration 16--
-bool(false)
-bool(false)
---Iteration 17--
-bool(false)
-bool(false)
---Iteration 18--
-bool(false)
-bool(false)
---Iteration 19--
-bool(false)
-bool(false)
---Iteration 20--
-bool(false)
-bool(false)
---Iteration 21--
-bool(false)
-bool(false)
---Iteration 22--
-bool(false)
-bool(false)
---Iteration 23--
-bool(false)
-bool(false)
---Iteration 24--
-bool(false)
-bool(false)
---Iteration 25--
-bool(false)
-bool(false)
---Iteration 26--
-bool(false)
-bool(false)
---Iteration 27--
-bool(false)
-bool(false)
---Iteration 28--
-bool(false)
-bool(false)
---Iteration 29--
-bool(false)
-bool(false)
---Iteration 30--
-bool(false)
-bool(false)
---Iteration 31--
-bool(false)
-bool(false)
---Iteration 32--
-bool(false)
-bool(false)
---Iteration 33--
-bool(false)
-bool(false)
---Iteration 34--
-bool(false)
-bool(false)
---Iteration 35--
-bool(false)
-bool(false)
---Iteration 36--
-bool(false)
-bool(false)
---Iteration 37--
-bool(false)
-bool(false)
-Done
diff --git a/ext/standard/tests/general_functions/is_float_alias.phpt b/ext/standard/tests/general_functions/is_float_alias.phpt
new file mode 100644
index 00000000000..db74a7e1298
--- /dev/null
+++ b/ext/standard/tests/general_functions/is_float_alias.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Test deprecated is_double aliases for is_float()
+
+--FILE--
+<?php
+
+var_dump(is_double("hello") === is_float("hello"));
+
+?>
+--EXPECTF--
+Deprecated: Function is_double() is deprecated since 8.6, use is_float() instead in %s on line %d
+bool(true)
diff --git a/ext/standard/tests/general_functions/is_int.phpt b/ext/standard/tests/general_functions/is_int.phpt
index 6dfcf9e1b42..3ec22708d80 100644
--- a/ext/standard/tests/general_functions/is_int.phpt
+++ b/ext/standard/tests/general_functions/is_int.phpt
@@ -1,62 +1,27 @@
--TEST--
-Test is_int() & it's FALIASes: is_long() & is_integer() functions
---SKIPIF--
-<?php
-if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
-?>
+Test is_int()
--FILE--
<?php
-echo "*** Testing is_int(), is_integer() & is_long() with valid integer values ***\n";
// different valid integer values
-$valid_ints = array(
+$valid_ints = [
0,
1,
-1,
- -2147483648, // max negative integer value
- -2147483647,
- 2147483647, // max positive integer value
+ PHP_INT_MAX,
+ PHP_INT_MIN,
2147483640,
- 0x123B, // integer as hexadecimal
- 0x12ab,
- 0Xfff,
- 0XFA,
- -0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max positive integer as hexadecimal
- 0x7FFFFFFF, // max positive integer as hexadecimal
- 0123, // integer as octal
- 01, // should be quivalent to octal 1
- -020000000000, // max negative integer as octal
- 017777777777, // max positive integer as octal
-);
-/* loop to check that is_int() recognizes different
- integer values, expected output: bool(true) */
-$loop_counter = 1;
-foreach ($valid_ints as $int_val ) {
- echo "--Iteration $loop_counter--\n"; $loop_counter++;
- var_dump( is_int($int_val) );
- var_dump( is_integer($int_val) );
- var_dump( is_long($int_val) );
-}
-
-echo "\n*** Testing is_int(), is_integer() & is_long() with non integer values ***\n";
+];
-// resource type variable
-$fp = fopen (__FILE__, "r");
-$dfp = opendir ( __DIR__ );
-// unset variable
-
-$unset_var = 10;
-unset ($unset_var);
+foreach ($valid_ints as $value ) {
+ if (!is_int($value)) {
+ echo "Value $value should be an int!\n";
+ }
+}
-// other types in a array
-$not_int_types = array (
+$not_int_types = [
/* float values */
- -2147483649, // float value
- 2147483648, // float value
- -0x80000001, // float value, beyond max negative int
- 0x800000001, // float value, beyond max positive int
- 020000000001, // float value, beyond max positive int
- -020000000001, // float value, beyond max negative int
+ PHP_INT_MIN-1,
+ PHP_INT_MAX+1,
0.0,
-0.1,
1.0,
@@ -67,364 +32,29 @@
10.0000000000000000005,
10.5e+5,
- /* objects */
- new stdclass,
-
- /* resources */
- $fp,
- $dfp,
-
- /* arrays */
+ new stdClass(),
+ STDOUT,
array(),
- array(0),
- array(1),
array(NULL),
- array(null),
- array("string"),
- array(true),
- array(TRUE),
- array(false),
- array(FALSE),
- array(1,2,3,4),
- array(1 => "One", "two" => 2),
-
- /* strings */
- "",
+ null,
+ true, // boolean
+ false,
'',
- "0",
'0',
- "1",
- '1',
- "\x01",
- '\x01',
- "\01",
- '\01',
- 'string',
- "string",
- "true",
- "FALSE",
- 'false',
- 'TRUE',
- "NULL",
- 'null',
+ '0.0',
+ '0.5',
+ '1e5',
+ '1.5e6_string',
+];
- /* booleans */
- true,
- false,
- TRUE,
- FALSE,
-
- /* undefined and unset vars */
- @$unset_var,
- @$undefined_var
-);
-/* loop through the $not_int_types to see working of
- is_int() on non integer types, expected output: bool(false) */
-$loop_counter = 1;
foreach ($not_int_types as $type ) {
- echo "--Iteration $loop_counter--\n"; $loop_counter++;
- var_dump( is_int($type) );
- var_dump( is_integer($type) );
- var_dump( is_long($type) );
+ if (is_int($type)) {
+ echo "Value $type should not be an int!\n";
+ }
}
echo "Done\n";
-// close the resources
-fclose($fp);
-closedir($dfp);
-
?>
--EXPECT--
-*** Testing is_int(), is_integer() & is_long() with valid integer values ***
---Iteration 1--
-bool(true)
-bool(true)
-bool(true)
---Iteration 2--
-bool(true)
-bool(true)
-bool(true)
---Iteration 3--
-bool(true)
-bool(true)
-bool(true)
---Iteration 4--
-bool(false)
-bool(false)
-bool(false)
---Iteration 5--
-bool(true)
-bool(true)
-bool(true)
---Iteration 6--
-bool(true)
-bool(true)
-bool(true)
---Iteration 7--
-bool(true)
-bool(true)
-bool(true)
---Iteration 8--
-bool(true)
-bool(true)
-bool(true)
---Iteration 9--
-bool(true)
-bool(true)
-bool(true)
---Iteration 10--
-bool(true)
-bool(true)
-bool(true)
---Iteration 11--
-bool(true)
-bool(true)
-bool(true)
---Iteration 12--
-bool(false)
-bool(false)
-bool(false)
---Iteration 13--
-bool(true)
-bool(true)
-bool(true)
---Iteration 14--
-bool(true)
-bool(true)
-bool(true)
---Iteration 15--
-bool(true)
-bool(true)
-bool(true)
---Iteration 16--
-bool(true)
-bool(true)
-bool(true)
---Iteration 17--
-bool(false)
-bool(false)
-bool(false)
---Iteration 18--
-bool(true)
-bool(true)
-bool(true)
-
-*** Testing is_int(), is_integer() & is_long() with non integer values ***
---Iteration 1--
-bool(false)
-bool(false)
-bool(false)
---Iteration 2--
-bool(false)
-bool(false)
-bool(false)
---Iteration 3--
-bool(false)
-bool(false)
-bool(false)
---Iteration 4--
-bool(false)
-bool(false)
-bool(false)
---Iteration 5--
-bool(false)
-bool(false)
-bool(false)
---Iteration 6--
-bool(false)
-bool(false)
-bool(false)
---Iteration 7--
-bool(false)
-bool(false)
-bool(false)
---Iteration 8--
-bool(false)
-bool(false)
-bool(false)
---Iteration 9--
-bool(false)
-bool(false)
-bool(false)
---Iteration 10--
-bool(false)
-bool(false)
-bool(false)
---Iteration 11--
-bool(false)
-bool(false)
-bool(false)
---Iteration 12--
-bool(false)
-bool(false)
-bool(false)
---Iteration 13--
-bool(false)
-bool(false)
-bool(false)
---Iteration 14--
-bool(false)
-bool(false)
-bool(false)
---Iteration 15--
-bool(false)
-bool(false)
-bool(false)
---Iteration 16--
-bool(false)
-bool(false)
-bool(false)
---Iteration 17--
-bool(false)
-bool(false)
-bool(false)
---Iteration 18--
-bool(false)
-bool(false)
-bool(false)
---Iteration 19--
-bool(false)
-bool(false)
-bool(false)
---Iteration 20--
-bool(false)
-bool(false)
-bool(false)
---Iteration 21--
-bool(false)
-bool(false)
-bool(false)
---Iteration 22--
-bool(false)
-bool(false)
-bool(false)
---Iteration 23--
-bool(false)
-bool(false)
-bool(false)
---Iteration 24--
-bool(false)
-bool(false)
-bool(false)
---Iteration 25--
-bool(false)
-bool(false)
-bool(false)
---Iteration 26--
-bool(false)
-bool(false)
-bool(false)
---Iteration 27--
-bool(false)
-bool(false)
-bool(false)
---Iteration 28--
-bool(false)
-bool(false)
-bool(false)
---Iteration 29--
-bool(false)
-bool(false)
-bool(false)
---Iteration 30--
-bool(false)
-bool(false)
-bool(false)
---Iteration 31--
-bool(false)
-bool(false)
-bool(false)
---Iteration 32--
-bool(false)
-bool(false)
-bool(false)
---Iteration 33--
-bool(false)
-bool(false)
-bool(false)
---Iteration 34--
-bool(false)
-bool(false)
-bool(false)
---Iteration 35--
-bool(false)
-bool(false)
-bool(false)
---Iteration 36--
-bool(false)
-bool(false)
-bool(false)
---Iteration 37--
-bool(false)
-bool(false)
-bool(false)
---Iteration 38--
-bool(false)
-bool(false)
-bool(false)
---Iteration 39--
-bool(false)
-bool(false)
-bool(false)
---Iteration 40--
-bool(false)
-bool(false)
-bool(false)
---Iteration 41--
-bool(false)
-bool(false)
-bool(false)
---Iteration 42--
-bool(false)
-bool(false)
-bool(false)
---Iteration 43--
-bool(false)
-bool(false)
-bool(false)
---Iteration 44--
-bool(false)
-bool(false)
-bool(false)
---Iteration 45--
-bool(false)
-bool(false)
-bool(false)
---Iteration 46--
-bool(false)
-bool(false)
-bool(false)
---Iteration 47--
-bool(false)
-bool(false)
-bool(false)
---Iteration 48--
-bool(false)
-bool(false)
-bool(false)
---Iteration 49--
-bool(false)
-bool(false)
-bool(false)
---Iteration 50--
-bool(false)
-bool(false)
-bool(false)
---Iteration 51--
-bool(false)
-bool(false)
-bool(false)
---Iteration 52--
-bool(false)
-bool(false)
-bool(false)
---Iteration 53--
-bool(false)
-bool(false)
-bool(false)
---Iteration 54--
-bool(false)
-bool(false)
-bool(false)
Done
diff --git a/ext/standard/tests/general_functions/is_int_64bit.phpt b/ext/standard/tests/general_functions/is_int_64bit.phpt
deleted file mode 100644
index 9676deea4cd..00000000000
--- a/ext/standard/tests/general_functions/is_int_64bit.phpt
+++ /dev/null
@@ -1,427 +0,0 @@
---TEST--
-Test is_int() & it's FALIASes: is_long() & is_integer() functions
---SKIPIF--
-<?php
-if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
-?>
---INI--
-precision=14
---FILE--
-<?php
-echo "*** Testing is_int(), is_integer() & is_long() with valid integer values ***\n";
-// different valid integer values
-$valid_ints = array(
- 0,
- 1,
- -1,
- -2147483648, // max negative integer value
- -2147483647,
- 2147483647, // max positive integer value
- 2147483640,
- 0x123B, // integer as hexadecimal
- 0x12ab,
- 0Xfff,
- 0XFA,
- -0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max positive integer as hexadecimal
- 0x7FFFFFFF, // max positive integer as hexadecimal
- 0123, // integer as octal
- 01, // should be quivalent to octal 1
- -020000000000, // max negative integer as octal
- 017777777777, // max positive integer as octal
-);
-/* loop to check that is_int() recognizes different
- integer values, expected output: bool(true) */
-$loop_counter = 1;
-foreach ($valid_ints as $int_val ) {
- echo "--Iteration $loop_counter--\n"; $loop_counter++;
- var_dump( is_int($int_val) );
- var_dump( is_integer($int_val) );
- var_dump( is_long($int_val) );
-}
-
-echo "\n*** Testing is_int(), is_integer() & is_long() with non integer values ***\n";
-
-// resource type variable
-$fp = fopen (__FILE__, "r");
-$dfp = opendir ( __DIR__ );
-// unset variable
-
-$unset_var = 10;
-unset ($unset_var);
-
-// other types in a array
-$not_int_types = array (
- /* float values */
- -2147483649, // float value
- 2147483648, // float value
- -0x80000001, // float value, beyond max negative int
- 0x800000001, // float value, beyond max positive int
- 020000000001, // float value, beyond max positive int
- -020000000001, // float value, beyond max negative int
- 0.0,
- -0.1,
- 1.0,
- 1e5,
- -1e6,
- 1E8,
- -1E9,
- 10.0000000000000000005,
- 10.5e+5,
-
- /* objects */
- new stdclass,
-
- /* resources */
- $fp,
- $dfp,
-
- /* arrays */
- array(),
- array(0),
- array(1),
- array(NULL),
- array(null),
- array("string"),
- array(true),
- array(TRUE),
- array(false),
- array(FALSE),
- array(1,2,3,4),
- array(1 => "One", "two" => 2),
-
- /* strings */
- "",
- '',
- "0",
- '0',
- "1",
- '1',
- "\x01",
- '\x01',
- "\01",
- '\01',
- 'string',
- "string",
- "true",
- "FALSE",
- 'false',
- 'TRUE',
- "NULL",
- 'null',
-
- /* booleans */
- true,
- false,
- TRUE,
- FALSE,
-
- /* undefined and unset vars */
- @$unset_var,
- @$undefined_var
-);
-/* loop through the $not_int_types to see working of
- is_int() on non integer types, expected output: bool(false) */
-$loop_counter = 1;
-foreach ($not_int_types as $type ) {
- echo "--Iteration $loop_counter--\n"; $loop_counter++;
- var_dump( is_int($type) );
- var_dump( is_integer($type) );
- var_dump( is_long($type) );
-}
-
-echo "Done\n";
-?>
---EXPECT--
-*** Testing is_int(), is_integer() & is_long() with valid integer values ***
---Iteration 1--
-bool(true)
-bool(true)
-bool(true)
---Iteration 2--
-bool(true)
-bool(true)
-bool(true)
---Iteration 3--
-bool(true)
-bool(true)
-bool(true)
---Iteration 4--
-bool(true)
-bool(true)
-bool(true)
---Iteration 5--
-bool(true)
-bool(true)
-bool(true)
---Iteration 6--
-bool(true)
-bool(true)
-bool(true)
---Iteration 7--
-bool(true)
-bool(true)
-bool(true)
---Iteration 8--
-bool(true)
-bool(true)
-bool(true)
---Iteration 9--
-bool(true)
-bool(true)
-bool(true)
---Iteration 10--
-bool(true)
-bool(true)
-bool(true)
---Iteration 11--
-bool(true)
-bool(true)
-bool(true)
---Iteration 12--
-bool(true)
-bool(true)
-bool(true)
---Iteration 13--
-bool(true)
-bool(true)
-bool(true)
---Iteration 14--
-bool(true)
-bool(true)
-bool(true)
---Iteration 15--
-bool(true)
-bool(true)
-bool(true)
---Iteration 16--
-bool(true)
-bool(true)
-bool(true)
---Iteration 17--
-bool(true)
-bool(true)
-bool(true)
---Iteration 18--
-bool(true)
-bool(true)
-bool(true)
-
-*** Testing is_int(), is_integer() & is_long() with non integer values ***
---Iteration 1--
-bool(true)
-bool(true)
-bool(true)
---Iteration 2--
-bool(true)
-bool(true)
-bool(true)
---Iteration 3--
-bool(true)
-bool(true)
-bool(true)
---Iteration 4--
-bool(true)
-bool(true)
-bool(true)
---Iteration 5--
-bool(true)
-bool(true)
-bool(true)
---Iteration 6--
-bool(true)
-bool(true)
-bool(true)
---Iteration 7--
-bool(false)
-bool(false)
-bool(false)
---Iteration 8--
-bool(false)
-bool(false)
-bool(false)
---Iteration 9--
-bool(false)
-bool(false)
-bool(false)
---Iteration 10--
-bool(false)
-bool(false)
-bool(false)
---Iteration 11--
-bool(false)
-bool(false)
-bool(false)
---Iteration 12--
-bool(false)
-bool(false)
-bool(false)
---Iteration 13--
-bool(false)
-bool(false)
-bool(false)
---Iteration 14--
-bool(false)
-bool(false)
-bool(false)
---Iteration 15--
-bool(false)
-bool(false)
-bool(false)
---Iteration 16--
-bool(false)
-bool(false)
-bool(false)
---Iteration 17--
-bool(false)
-bool(false)
-bool(false)
---Iteration 18--
-bool(false)
-bool(false)
-bool(false)
---Iteration 19--
-bool(false)
-bool(false)
-bool(false)
---Iteration 20--
-bool(false)
-bool(false)
-bool(false)
---Iteration 21--
-bool(false)
-bool(false)
-bool(false)
---Iteration 22--
-bool(false)
-bool(false)
-bool(false)
---Iteration 23--
-bool(false)
-bool(false)
-bool(false)
---Iteration 24--
-bool(false)
-bool(false)
-bool(false)
---Iteration 25--
-bool(false)
-bool(false)
-bool(false)
---Iteration 26--
-bool(false)
-bool(false)
-bool(false)
---Iteration 27--
-bool(false)
-bool(false)
-bool(false)
---Iteration 28--
-bool(false)
-bool(false)
-bool(false)
---Iteration 29--
-bool(false)
-bool(false)
-bool(false)
---Iteration 30--
-bool(false)
-bool(false)
-bool(false)
---Iteration 31--
-bool(false)
-bool(false)
-bool(false)
---Iteration 32--
-bool(false)
-bool(false)
-bool(false)
---Iteration 33--
-bool(false)
-bool(false)
-bool(false)
---Iteration 34--
-bool(false)
-bool(false)
-bool(false)
---Iteration 35--
-bool(false)
-bool(false)
-bool(false)
---Iteration 36--
-bool(false)
-bool(false)
-bool(false)
---Iteration 37--
-bool(false)
-bool(false)
-bool(false)
---Iteration 38--
-bool(false)
-bool(false)
-bool(false)
---Iteration 39--
-bool(false)
-bool(false)
-bool(false)
---Iteration 40--
-bool(false)
-bool(false)
-bool(false)
---Iteration 41--
-bool(false)
-bool(false)
-bool(false)
---Iteration 42--
-bool(false)
-bool(false)
-bool(false)
---Iteration 43--
-bool(false)
-bool(false)
-bool(false)
---Iteration 44--
-bool(false)
-bool(false)
-bool(false)
---Iteration 45--
-bool(false)
-bool(false)
-bool(false)
---Iteration 46--
-bool(false)
-bool(false)
-bool(false)
---Iteration 47--
-bool(false)
-bool(false)
-bool(false)
---Iteration 48--
-bool(false)
-bool(false)
-bool(false)
---Iteration 49--
-bool(false)
-bool(false)
-bool(false)
---Iteration 50--
-bool(false)
-bool(false)
-bool(false)
---Iteration 51--
-bool(false)
-bool(false)
-bool(false)
---Iteration 52--
-bool(false)
-bool(false)
-bool(false)
---Iteration 53--
-bool(false)
-bool(false)
-bool(false)
---Iteration 54--
-bool(false)
-bool(false)
-bool(false)
-Done
diff --git a/ext/standard/tests/general_functions/is_int_aliases.phpt b/ext/standard/tests/general_functions/is_int_aliases.phpt
new file mode 100644
index 00000000000..f9a0b0da0d2
--- /dev/null
+++ b/ext/standard/tests/general_functions/is_int_aliases.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Test deprecated is_long/is_integer aliases for is_int()
+
+--FILE--
+<?php
+
+var_dump(is_long("hello") === is_int("hello"));
+var_dump(is_integer("hello") === is_int("hello"));
+
+?>
+--EXPECTF--
+Deprecated: Function is_long() is deprecated since 8.6, use is_int() instead in %s on line %d
+bool(true)
+
+Deprecated: Function is_integer() is deprecated since 8.6, use is_int() instead in %s on line %d
+bool(true)