Skip to content

Commit 0b14af3

Browse files
committed
1 parent 7cc1432 commit 0b14af3

25 files changed

Lines changed: 242 additions & 1810 deletions

Zend/tests/type_declarations/union_types/incdec_prop.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,40 @@ class Test {
1313
$test = new Test;
1414
$test->prop = PHP_INT_MAX;
1515
$x = $test->prop++;
16-
var_dump(is_double($test->prop));
16+
var_dump(is_float($test->prop));
1717

1818
$test->prop = PHP_INT_MAX;
1919
$x = ++$test->prop;
20-
var_dump(is_double($test->prop));
20+
var_dump(is_float($test->prop));
2121

2222
$test->prop = PHP_INT_MIN;
2323
$x = $test->prop--;
24-
var_dump(is_double($test->prop));
24+
var_dump(is_float($test->prop));
2525

2626
$test->prop = PHP_INT_MIN;
2727
$x = --$test->prop;
28-
var_dump(is_double($test->prop));
28+
var_dump(is_float($test->prop));
2929

3030
$test = new Test;
3131
$test->prop = PHP_INT_MAX;
3232
$r =& $test->prop;
3333
$x = $test->prop++;
34-
var_dump(is_double($test->prop));
34+
var_dump(is_float($test->prop));
3535

3636
$test->prop = PHP_INT_MAX;
3737
$x = ++$test->prop;
3838
$r =& $test->prop;
39-
var_dump(is_double($test->prop));
39+
var_dump(is_float($test->prop));
4040

4141
$test->prop = PHP_INT_MIN;
4242
$x = $test->prop--;
4343
$r =& $test->prop;
44-
var_dump(is_double($test->prop));
44+
var_dump(is_float($test->prop));
4545

4646
$test->prop = PHP_INT_MIN;
4747
$x = --$test->prop;
4848
$r =& $test->prop;
49-
var_dump(is_double($test->prop));
49+
var_dump(is_float($test->prop));
5050

5151
/* Incrementing a non-int|float property past int min/max is an error,
5252
* even if the result of the overflow (a float) would technically be allowed

Zend/zend_compile.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5387,14 +5387,9 @@ static zend_result zend_try_compile_special_func_ex(znode *result, zend_string *
53875387
return zend_compile_func_typecheck(result, args, IS_NULL);
53885388
} else if (zend_string_equals_literal(lcname, "is_bool")) {
53895389
return zend_compile_func_typecheck(result, args, _IS_BOOL);
5390-
} else if (zend_string_equals_literal(lcname, "is_long")
5391-
|| zend_string_equals_literal(lcname, "is_int")
5392-
|| zend_string_equals_literal(lcname, "is_integer")
5393-
) {
5390+
} else if (zend_string_equals_literal(lcname, "is_int")) {
53945391
return zend_compile_func_typecheck(result, args, IS_LONG);
5395-
} else if (zend_string_equals_literal(lcname, "is_float")
5396-
|| zend_string_equals_literal(lcname, "is_double")
5397-
) {
5392+
} else if (zend_string_equals_literal(lcname, "is_float")) {
53985393
return zend_compile_func_typecheck(result, args, IS_DOUBLE);
53995394
} else if (zend_string_equals_literal(lcname, "is_string")) {
54005395
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 *
54105405
return zend_compile_func_cast(result, args, _IS_BOOL);
54115406
} else if (zend_string_equals_literal(lcname, "intval")) {
54125407
return zend_compile_func_cast(result, args, IS_LONG);
5413-
} else if (zend_string_equals_literal(lcname, "floatval")
5414-
|| zend_string_equals_literal(lcname, "doubleval")
5415-
) {
5408+
} else if (zend_string_equals_literal(lcname, "floatval")) {
54165409
return zend_compile_func_cast(result, args, IS_DOUBLE);
54175410
} else if (zend_string_equals_literal(lcname, "strval")) {
54185411
return zend_compile_func_cast(result, args, IS_STRING);

ext/date/tests/strtotime-mysql-64bit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $d[] = '20800410101010'; // overflow..
1414
foreach($d as $date) {
1515
$time = strtotime($date);
1616

17-
if (is_integer($time)) {
17+
if (is_int($time)) {
1818
var_dump(date('r', $time));
1919
} else {
2020
var_dump($time);

ext/date/tests/strtotime-mysql.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $d[] = '20800410101010'; // overflow..
1414
foreach($d as $date) {
1515
$time = strtotime($date);
1616

17-
if (is_integer($time)) {
17+
if (is_int($time)) {
1818
var_dump(date('r', $time));
1919
} else {
2020
var_dump($time);

ext/date/tests/strtotime3-64bit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $strs = array(
3636

3737
foreach ($strs as $str) {
3838
$t = strtotime($str, $time);
39-
if (is_integer($t)) {
39+
if (is_int($t)) {
4040
var_dump(date(DATE_RFC2822, $t));
4141
} else {
4242
var_dump($t);

ext/date/tests/strtotime3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $strs = array(
3636

3737
foreach ($strs as $str) {
3838
$t = strtotime($str, $time);
39-
if (is_integer($t)) {
39+
if (is_int($t)) {
4040
var_dump(date(DATE_RFC2822, $t));
4141
} else {
4242
var_dump($t);

ext/filter/tests/046.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ default:
2424
function test_validation($val, $msg) {
2525
$f = filter_var($val, FILTER_VALIDATE_INT);
2626
echo "$msg filtered: "; var_dump($f); // filtered value (or false)
27-
echo "$msg is_long: "; var_dump(is_long($f)); // test validation
27+
echo "$msg is_int: "; var_dump(is_int($f)); // test validation
2828
echo "$msg equal: "; var_dump($val == $f); // test equality of result
2929
}
3030

@@ -36,14 +36,14 @@ test_validation($underflow, "underflow");
3636
?>
3737
--EXPECTF--
3838
max filtered: int(%d)
39-
max is_long: bool(true)
39+
max is_int: bool(true)
4040
max equal: bool(true)
4141
overflow filtered: bool(false)
42-
overflow is_long: bool(false)
42+
overflow is_int: bool(false)
4343
overflow equal: bool(false)
4444
min filtered: int(-%d)
45-
min is_long: bool(true)
45+
min is_int: bool(true)
4646
min equal: bool(true)
4747
underflow filtered: bool(false)
48-
underflow is_long: bool(false)
48+
underflow is_int: bool(false)
4949
underflow equal: bool(false)

ext/filter/tests/047.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ function octal_inc($s) {
1919

2020

2121
$s = sprintf("%o", PHP_INT_MAX);
22-
var_dump(is_long(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
22+
var_dump(is_int(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
2323

2424
$s = octal_inc($s);
25-
var_dump(is_long(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
25+
var_dump(is_int(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
2626

2727
$s = sprintf("%o", ~0);
28-
var_dump(is_long(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
28+
var_dump(is_int(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))));
2929

3030
$s = octal_inc($s);
3131
var_dump(filter_var('0'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));

ext/filter/tests/048.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ function hex_inc($s) {
2323

2424

2525
$s = sprintf("%x", PHP_INT_MAX);
26-
var_dump(is_long(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
26+
var_dump(is_int(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
2727

2828
$s = hex_inc($s);
29-
var_dump(is_long(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
29+
var_dump(is_int(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
3030

3131
$s = sprintf("%x", ~0);
32-
var_dump(is_long(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
32+
var_dump(is_int(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX))));
3333

3434
$s = hex_inc($s);
3535
var_dump(filter_var('0x'.$s, FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));

ext/pgsql/tests/20pg_get_pid.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include('inc/config.inc');
1313
$db = pg_connect($conn_str);
1414
$pid = pg_get_pid($db);
1515

16-
is_integer($pid) ? print 'OK' : print 'NG';
16+
is_int($pid) ? print 'OK' : print 'NG';
1717
?>
1818
--EXPECT--
1919
OK

0 commit comments

Comments
 (0)