Bug #74480 [NEW]: Cast error from String to Int

From: Date: Thu, 20 Apr 2017 14:36:47 +0000
Subject: Bug #74480 [NEW]: Cast error from String to Int
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208680@lists.php.net to get a copy of this message
From: philipp dot kremer at prolead-technologies dot de Operating system: Windows 10 PHP version: 7.1.4 Package: *General Issues Bug Type: Bug Bug description:Cast error from String to Int Description: ------------ Type cast from String to Int are not working correctly. System windows 10 64bit PHP 7.1.4 32bit > php -v PHP 7.1.4 (cli) (built: Apr 11 2017 20:07:48) ( NTS MSVC14 (Visual C++ 2015) x86 ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies > php -m [PHP Modules] bcmath bz2 calendar Core ctype curl date dom filter gettext hash iconv imap intl json libxml mbstring mcrypt mysqlnd openssl pcre PDO pdo_mysql Phar readline Reflection session shmop SimpleXML soap SPL standard tokenizer wddx xml xmlreader xmlwriter zip zlib [Zend Modules] Test script: --------------- <?php $mandant_id = "2147483647"; var_dump($mandant_id, (int)$mandant_id); $mandant_id = "122994595930"; var_dump($mandant_id, (int)$mandant_id); Expected result: ---------------- string(10) "2147483647" int(2147483647) string(12) "122994595930" int(122994595930) or string(10) "2147483647" int(2147483647) string(12) "122994595930" float(122994595930) Actual result: -------------- string(10) "2147483647" int(2147483647) string(12) "122994595930" int(2147483647) -- Edit bug report at https://bugs.php.net/bug.php?id=74480&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74480&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74480&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74480&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74480&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74480&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74480&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74480&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74480&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74480&r=support Expected behavior: https://bugs.php.net/fix.php?id=74480&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74480&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74480&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74480&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74480&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74480&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74480&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74480&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74480&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74480&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74480&r=mysqlcfg

« previous php.bugs (#208680) next »