Bug #76074 [NEW]: opcache corrupts variable in for-loop
| From: | sjon at hortensius dot net | Date: | Fri, 09 Mar 2018 13:15:40 +0000 |
| Subject: | Bug #76074 [NEW]: opcache corrupts variable in for-loop | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-214251@lists.php.net to get a copy of this message | ||
From: sjon at hortensius dot net
Operating system: archlinux
PHP version: 7.2.3
Package: opcache
Bug Type: Bug
Bug description:opcache corrupts variable in for-loop
Description:
------------
A for-loop that uses condition $i < $x + 1 prints very weird numbers.
This requires you to ENABLE the opcache and DISABLE xdebug.
Test script:
---------------
function test(int $nr) {
for ($i = $nr; $i <= $nr + 1; $i++)
var_dump($i);
}
test(1);
Expected result:
----------------
int(1)
int(2)
Actual result:
--------------
int(-9223372036854775808)
int(-9223372036854775808)
--
Edit bug report at https://bugs.php.net/bug.php?id=76074&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76074&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76074&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76074&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76074&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76074&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76074&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76074&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76074&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76074&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76074&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76074&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76074&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76074&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76074&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76074&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76074&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76074&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76074&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76074&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76074&r=mysqlcfg