Bug #79843 [NEW]: Running intval to string value that is supposed to be INF returns 0
| From: | taira dot 815 dot terashima at gmail dot com | Date: | Mon, 13 Jul 2020 09:46:37 +0000 |
| Subject: | Bug #79843 [NEW]: Running intval to string value that is supposed to be INF returns 0 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227990@lists.php.net to get a copy of this message | ||
From: taira dot 815 dot terashima at gmail dot com
Operating system: Ubuntu18.04
PHP version: 7.4.8
Package: Strings related
Bug Type: Bug
Bug description:Running intval to string value that is supposed to be INF returns 0
Description:
------------
Running function intval using a string value more than a certain number
(maybe DOUBLE MAX) returns 0.
Test script:
---------------
<?php
// It returns 0. (This string value is 2^1024)
$number =
intval('179769313486231570772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216');
echo $number;
Expected result:
----------------
INF
Actual result:
--------------
0
--
Edit bug report at https://bugs.php.net/bug.php?id=79843&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79843&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79843&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79843&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79843&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79843&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79843&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79843&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79843&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79843&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79843&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79843&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79843&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79843&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79843&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79843&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79843&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79843&r=mysqlcfg