Skip to content

Commit ff27d73

Browse files
author
Sjoerd Langkemper
committed
Fix test by creating large integer differently
The test for overflow used a large integer, larger than PHP_INT_MAX. Previously it used base_convert to create an integer 4 * PHP_INT_MAX, but that now raises an overflow warning. We now use PHP_INT_MAX and append a zero, giving 10 * PHP_INT_MAX. We can't just use 4 * PHP_INT_MAX, because that is converted to a float and represented as 3.6893488147419E+19 instead of 36893488147419104082.
1 parent 1301be7 commit ff27d73

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Zend/tests/zend_ini/zend_ini_parse_uquantity_overflow.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ $tests = [
1515
'No overflow 007' => ' -1',
1616
'No overflow 008' => '-1 ',
1717
'No overflow 009' => ' -1 ',
18-
'Subject overflow 001' => base_convert(str_repeat('1', PHP_INT_SIZE*8+1), 2, 10),
19-
'Subject overflow 002' => '-'.base_convert(str_repeat('1', PHP_INT_SIZE*8+1), 2, 10),
18+
'Subject overflow 001' => PHP_INT_MAX.'0',
19+
'Subject overflow 002' => PHP_INT_MIN.'0',
2020
'Subject overflow 003' => strval(PHP_INT_MIN),
2121
'Subject overflow 004' => '-2',
2222
'Subject overflow 005' => '-1K',

0 commit comments

Comments
 (0)