Bug #70656 [NEW]: opcache_reset() breaks "require"

From: Date: Wed, 07 Oct 2015 04:40:33 +0000
Subject: Bug #70656 [NEW]: opcache_reset() breaks "require"
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196443@lists.php.net to get a copy of this message
From: p at wspnr dot com Operating system: Debian (x86_64 and i686) PHP version: 7.0Git-2015-10-07 (Git) Package: opcache Bug Type: Bug Bug description:opcache_reset() breaks "require" Description: ------------ Calling \opcache_reset() breaks the "require" statement on future page loads. The only thing that seems to fix it is restarting PHP-FPM. The require fails, stating that it can't find the file path. The file path listed begins with the correct path, but is then followed by junk data. The 'junk' data seems to be other strings from the file(s). Tested and reproduced on both 64-bit and 32-bit builds. Test script: --------------- This is split into three files, running with opcache enabled: -- file1.php -- <?php namespace my\nsname; require 'file3.php'; class MyClass implements MyInterface {} new MyClass(); echo 'I am file 1'; -- file2.php -- <?php namespace my\nsname; \opcache_reset(); echo 'I am file 2'; -- file3.php -- <?php namespace my\nsname; interface MyInterface {} echo 'I am file 3'; -- TEST -- Load, in sequence: file1.php file2.php file3.php file1.php Expected result: ---------------- I am file 3 I am file 1 I am file 2 I am file 3 I am file 3 I am file 1 Actual result: -------------- I am file 3 I am file 1 I am file 2 I am file 3 Fatal error: require(): Failed opening required 'file3.php\myinte' (include_path='.:') in /.../file1.php on line 5 -- Edit bug report at https://bugs.php.net/bug.php?id=70656&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70656&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70656&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70656&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70656&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70656&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70656&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70656&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70656&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70656&r=support Expected behavior: https://bugs.php.net/fix.php?id=70656&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70656&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70656&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70656&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70656&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70656&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70656&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70656&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70656&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70656&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70656&r=mysqlcfg

« previous php.bugs (#196443) next »