xref: /php-src/Zend/tests/bug48770.phpt (revision ee510eed)
1--TEST--
2Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
3--FILE--
4<?php
5
6class A {
7    public function func($arg) {
8        echo "A::func called\n";
9    }
10}
11
12class B extends A {
13    public function func($arg) {
14        echo "B::func called\n";
15    }
16
17    public function callFuncInParent($arg) {
18        call_user_func_array(array($this, 'parent::func'), array($arg));
19    }
20}
21
22class C extends B {
23    public function func($arg) {
24        echo "C::func called\n";
25        parent::func($str);
26    }
27}
28
29$c = new C;
30$c->callFuncInParent('Which function will be called??');
31
32?>
33--EXPECTF--
34Deprecated: Callables of the form ["C", "parent::func"] are deprecated in %s on line %d
35B::func called
36