1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

Merge branch 'PHP-5.5'

This commit is contained in:
Xinchen Hui
2013-06-24 23:53:54 +08:00
2 changed files with 29 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #65108 (is_callable() triggers Fatal Error)
--FILE--
<?php
class C {
private function f() {}
static function __callStatic($name, $args) {}
}
class B {
public function B() {
$isCallable = is_callable(array(new C, 'f'));
var_dump($isCallable);
}
}
new B();
Class E {
private function f() {}
function __call($name, $args) {}
}
$isCallable = is_callable(array('E', 'f'));
var_dump($isCallable);
--EXPECT--
bool(false)
bool(false)
+2 -2
View File
@@ -2842,8 +2842,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
}
if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 &&
(fcc->calling_scope &&
((fcc->calling_scope->__call && fcc->object_ptr) ||
fcc->calling_scope->__callstatic))) {
((fcc->object_ptr && fcc->calling_scope->__call) ||
(!fcc->object_ptr && fcc->calling_scope->__callstatic)))) {
if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) {
retval = 0;