summaryrefslogtreecommitdiff
path: root/ext/opcache/Optimizer/pass1_5.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-03-25 23:27:50 +0800
committerXinchen Hui <laruence@php.net>2015-03-25 23:29:18 +0800
commite46e9a3d22c22ec567423c25f83a6fd7f9655c52 (patch)
tree72243e135bf2d1d09661852436be67fc4eb51cfd /ext/opcache/Optimizer/pass1_5.c
parent7461c5224880f3b476b46b6568e2acf61ce3d13d (diff)
downloadphp-git-e46e9a3d22c22ec567423c25f83a6fd7f9655c52.tar.gz
Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function)
is_callable returns true for disable_functions, but function_exists return false for it.
Diffstat (limited to 'ext/opcache/Optimizer/pass1_5.c')
-rw-r--r--ext/opcache/Optimizer/pass1_5.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 731040e960..79416cc8c2 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -380,7 +380,13 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
func->type == ZEND_INTERNAL_FUNCTION &&
func->module->type == MODULE_PERSISTENT) {
zval t;
- ZVAL_BOOL(&t, 1);
+ if ((Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof("is_callable")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), "is_callable", sizeof("is_callable"))) ||
+ func->handler != ZEND_FN(display_disabled_function)) {
+ ZVAL_BOOL(&t, 1);
+ } else {
+ ZVAL_BOOL(&t, 0);
+ }
if (replace_var_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
literal_dtor(&ZEND_OP1_LITERAL(opline - 1));
MAKE_NOP((opline - 1));