xref: /PHP-8.0/Zend/tests/call_static_007.phpt (revision f8d79582)
1--TEST--
2Testing __call and __callstatic
3--FILE--
4<?php
5
6class a {
7    public function __call($a, $b) {
8        print "__call: ". $a ."\n";
9    }
10    static public function __callStatic($a, $b) {
11        print "__callstatic: ". $a ."\n";
12    }
13    public function baz() {
14        self::Bar();
15    }
16}
17
18
19$a = new a;
20
21$b = 'Test';
22$a::$b();
23$a->$b();
24
25$a->baz();
26
27a::Foo();
28
29?>
30--EXPECT--
31__callstatic: Test
32__call: Test
33__call: Bar
34__callstatic: Foo
35