1--TEST--
2Indirect call with 'Class::method' syntax with class in namespace
3--FILE--
4<?php
5namespace TestNamespace
6{
7    class TestClass
8    {
9        public static function staticMethod()
10        {
11            echo "Static method called!\n";
12        }
13
14        public static function staticMethodWithArgs($arg1, $arg2, $arg3)
15        {
16            printf("Static method called with args: %s, %s, %s\n", $arg1, $arg2, $arg3);
17        }
18    }
19}
20
21namespace CallNamespace
22{
23    // Test basic call using Class::method syntax.
24    $callback = 'TestNamespace\TestClass::staticMethod';
25    $callback();
26
27    // Case should not matter.
28    $callback = 'testnamespace\testclass::staticmethod';
29    $callback();
30
31    $args = ['arg1', 'arg2', 'arg3'];
32    $callback = 'TestNamespace\TestClass::staticMethodWithArgs';
33
34    // Test call with args.
35    $callback($args[0], $args[1], $args[2]);
36
37    // Test call with splat operator.
38    $callback(...$args);
39}
40?>
41--EXPECT--
42Static method called!
43Static method called!
44Static method called with args: arg1, arg2, arg3
45Static method called with args: arg1, arg2, arg3
46