1--TEST--
2Bug #40398 (parent and self callback functions erroneously called statically)
3--FILE--
4<?php
5
6class Base
7{
8    function __construct($msg)
9    {
10        echo __METHOD__ . "($msg)\n";
11    }
12}
13
14class Derived_1 extends Base
15{
16    public function __construct()
17    {
18        $args = func_get_args();
19        call_user_func_array(array($this, 'Base::__construct'), $args);
20    }
21}
22
23class Derived_2 extends Base
24{
25    public function __construct()
26    {
27        $args = func_get_args();
28        call_user_func_array(array($this, 'parent::__construct'), $args);
29    }
30}
31
32class Derived_3 extends Base
33{
34    public function __construct()
35    {
36        $args = func_get_args();
37        call_user_func_array('Base::__construct', $args);
38    }
39}
40
41class Derived_4 extends Base
42{
43    public function __construct()
44    {
45        $args = func_get_args();
46        call_user_func_array('parent::__construct', $args);
47    }
48}
49
50class Derived_5 extends Base
51{
52    public function __construct()
53    {
54        $args = func_get_args();
55        call_user_func_array(array('Base', '__construct'), $args);
56    }
57}
58
59class Derived_6 extends Base
60{
61    public function __construct()
62    {
63        $args = func_get_args();
64        call_user_func_array(array('parent', '__construct'), $args);
65    }
66}
67
68new Derived_1('1');
69new Derived_2('2');
70new Derived_3('3');
71new Derived_4('4');
72new Derived_5('5');
73new Derived_6('6');
74
75?>
76--EXPECTF--
77Deprecated: Callables of the form ["Derived_1", "Base::__construct"] are deprecated in %s on line %d
78Base::__construct(1)
79
80Deprecated: Callables of the form ["Derived_2", "parent::__construct"] are deprecated in %s on line %d
81Base::__construct(2)
82Base::__construct(3)
83
84Deprecated: Use of "parent" in callables is deprecated in %s on line %d
85Base::__construct(4)
86Base::__construct(5)
87
88Deprecated: Use of "parent" in callables is deprecated in %s on line %d
89Base::__construct(6)
90