xref: /PHP-8.1/tests/classes/__call_001.phpt (revision f8d79582)
1--TEST--
2ZE2 __call()
3--FILE--
4<?php
5
6class Caller {
7    public $x = array(1, 2, 3);
8
9    function __call($m, $a) {
10        echo "Method $m called:\n";
11        var_dump($a);
12        return $this->x;
13    }
14}
15
16$foo = new Caller();
17$a = $foo->test(1, '2', 3.4, true);
18var_dump($a);
19
20?>
21--EXPECT--
22Method test called:
23array(4) {
24  [0]=>
25  int(1)
26  [1]=>
27  string(1) "2"
28  [2]=>
29  float(3.4)
30  [3]=>
31  bool(true)
32}
33array(3) {
34  [0]=>
35  int(1)
36  [1]=>
37  int(2)
38  [2]=>
39  int(3)
40}
41