mirror of
https://github.com/php/php-src.git
synced 2026-04-14 03:22:58 +02:00
34
Zend/tests/bug78898.phpt
Normal file
34
Zend/tests/bug78898.phpt
Normal 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
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user