1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 03:22:58 +02:00

Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #78898
This commit is contained in:
Nikita Popov
2019-12-04 09:41:51 +01:00
2 changed files with 41 additions and 5 deletions

34
Zend/tests/bug78898.phpt Normal file
View File

@@ -0,0 +1,34 @@
--TEST--
Bug #78898: call_user_func(['parent', ...]) fails while other succeed
--FILE--
<?php
class A
{
protected function _x()
{
echo "a";
}
public function __call($methodName, array $arguments)
{
throw new Exception("Unknown method.");
}
}
class B extends A
{
public function x()
{
parent::_x();
call_user_func('parent::_x');
call_user_func(['parent', '_x']);
}
}
$b = new B;
$b->x();
?>
--EXPECT--
aaa

View File

@@ -2933,11 +2933,13 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
((fcc->object && fcc->calling_scope->__call) ||
(!fcc->object && fcc->calling_scope->__callstatic)))) {
scope = zend_get_executed_scope();
if (fcc->function_handler->common.scope != scope
|| !zend_check_protected(zend_get_function_root_class(fcc->function_handler), scope)) {
retval = 0;
fcc->function_handler = NULL;
goto get_function_via_handler;
if (fcc->function_handler->common.scope != scope) {
if ((fcc->function_handler->common.fn_flags & ZEND_ACC_PRIVATE)
|| !zend_check_protected(zend_get_function_root_class(fcc->function_handler), scope)) {
retval = 0;
fcc->function_handler = NULL;
goto get_function_via_handler;
}
}
}
} else {