|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-03-25 13:24 UTC] laruence@php.net
-Assigned To:
+Assigned To: laruence
[2015-03-25 15:51 UTC] laruence@php.net
[2015-03-25 15:51 UTC] laruence@php.net
-Status: Assigned
+Status: Closed
[2015-03-25 15:51 UTC] laruence@php.net
[2015-03-30 12:21 UTC] laruence@php.net
[2016-07-20 11:39 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 00:00:02 2025 UTC |
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)