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