xref: /PHP-7.4/tests/classes/__call_005.phpt (revision d7a3edd4)
1--TEST--
2When __call() is invoked via ::, ensure private implementation of __call() in superclass is accessed without error.
3--FILE--
4<?php
5class A {
6	private function __call($strMethod, $arrArgs) {
7		echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n";
8		var_dump($this);
9	}
10}
11
12class B extends A {
13	function test() {
14		A::test1(1,'a');
15		B::test2(1,'a');
16		self::test3(1,'a');
17		parent::test4(1,'a');
18	}
19}
20
21$b = new B();
22$b->test();
23?>
24--EXPECTF--
25Warning: The magic method __call() must have public visibility and cannot be static in %s__call_005.php on line 3
26In A::__call(test1, array(1,a))
27object(B)#1 (0) {
28}
29In A::__call(test2, array(1,a))
30object(B)#1 (0) {
31}
32In A::__call(test3, array(1,a))
33object(B)#1 (0) {
34}
35In A::__call(test4, array(1,a))
36object(B)#1 (0) {
37}
38