Bug #66066 [NEW]: opcache_compile_file partially execute file and output errors
| From: | geompse at gmail dot com | Date: | Fri, 08 Nov 2013 16:18:00 +0000 |
| Subject: | Bug #66066 [NEW]: opcache_compile_file partially execute file and output errors | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182665@lists.php.net to get a copy of this message | ||
From: geompse at gmail dot com
Operating system: Debian 3.8.13
PHP version: 5.5.5
Package: opcache
Bug Type: Bug
Bug description:opcache_compile_file partially execute file and output errors
Description:
------------
---
From manual page: http://www.php.net/function.opcache-compile-file
"Compiles and caches a PHP script without executing it"
---
As the documentation says, the script should not be executed (and it is
not).
But when trying to compile the current file, or an already
included/required file, the function generate a Fatal Error and a
Warning (wich can both by visually suppressed when using "@").
Practical use : updater script
- overwrite files with new ones
- force opcache recompilation
The update is in the framework, and updates the framework. All
already-included classes are already defined, and thus the compilation
fail (or seems to fail, anyways it reports a failure).
Test script:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
function coucou()
{
}
echo 'Before'."\n";
opcache_compile_file(__FILE__);
echo 'After'."\n";
?>
Expected result:
----------------
Before
After
Actual result:
--------------
Before
Fatal error: Cannot redeclare coucou() (previously declared in
/root/compile.php:8) in /root/compile.php on line 8
Warning: Zend OPcache could not compile file /root/compile.php in
Unknown on line 0
After
--
Edit bug report at https://bugs.php.net/bug.php?id=66066&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66066&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66066&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66066&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66066&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66066&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66066&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66066&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66066&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66066&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66066&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66066&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66066&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66066&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66066&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66066&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66066&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66066&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66066&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66066&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66066&r=mysqlcfg