Bug #69297 [NEW]: function_exists strange behavior with OPCache on disabled function

From: Date: Wed, 25 Mar 2015 11:53:55 +0000
Subject: Bug #69297 [NEW]: function_exists strange behavior with OPCache on disabled function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191594@lists.php.net to get a copy of this message
From: d dot ccigii at gmail dot com Operating system: GNU/Linux, Centos 6.6 PHP version: 5.6.7 Package: opcache Bug Type: Bug Bug description:function_exists strange behavior with OPCache on disabled function Description: ------------ I stumbled upon strange behavior of php function function_exists(), when called on disabled function (in php.ini - disable_function). The thing is, that if I provide the function name parameter directly as string, the result is different than when provided as variable. When called first time, result is fine. But when the result is served by the OPCache, results are wrong. Tested in clean build of PHP 5.6 and 5.7, with shipped OPCache (Zend OPcache v7.0.4-dev). In PHP 5.5, the results are correct. PHP Build: ./configure --prefix=/usr/local/php/5.6.7-test PHP config: disable_functions = posix_getpwuid date.timezone = Europe/Prague zend_extension=/usr/local/php/5.6.7-test/lib/php/extensions/no-debug-non-zts-20131226/opcache.so Test script: --------------- <? echo phpversion() . "\n"; $f='posix_getpwuid'; $r1=function_exists('posix_getpwuid'); $r2=function_exists($f); echo "\n\n"; echo "string: "; var_dump ($r1); echo "var. : "; var_dump ($r2); echo "opcache status: "; var_dump(opcache_get_status()['opcache_enabled']); Expected result: ---------------- This is the result of the first call, this is how it should be: # /usr/local/php/php-TEST/bin/php-cgi -c /data/web/php-test/ fce.php X-Powered-By: PHP/5.6.7 Content-type: text/html; charset=UTF-8 5.6.7 string: bool(false) # <--- correct result var. : bool(false) opcache status: bool(true) Actual result: -------------- Any subsequent call: # /usr/local/php/php-TEST/bin/php-cgi -c /data/web/php-test/ fce.php X-Powered-By: PHP/5.6.7 Content-type: text/html; charset=UTF-8 5.6.7 string: bool(true) # <--- HERE IS THE ERROR var. : bool(false) opcache status: bool(true) -- Edit bug report at https://bugs.php.net/bug.php?id=69297&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69297&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69297&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69297&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69297&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69297&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69297&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69297&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69297&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69297&r=support Expected behavior: https://bugs.php.net/fix.php?id=69297&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69297&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69297&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69297&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69297&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69297&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69297&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69297&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69297&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69297&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69297&r=mysqlcfg

« previous php.bugs (#191594) next »