+++ /dev/null
---TEST--
-Invalid method name in dynamic static call
---FILE--
-<?php
-
-class foo {
- static function __callstatic($a, $b) {
- var_dump($a);
- }
-}
-
-try {
- $a = 'foo::';
- $a();
-} catch (Error $e) {
- echo $e->getMessage();
-}
-
-?>
---EXPECT--
-Call to undefined function foo::()
--- /dev/null
+--TEST--
+Indirect call with 'Class::method' syntax with class in namespace
+--FILE--
+<?php
+namespace TestNamespace
+{
+ class TestClass
+ {
+ public static function staticMethod()
+ {
+ echo "Static method called!\n";
+ }
+
+ public static function staticMethodWithArgs($arg1, $arg2, $arg3)
+ {
+ printf("Static method called with args: %s, %s, %s\n", $arg1, $arg2, $arg3);
+ }
+ }
+
+ // Test basic call using Class::method syntax.
+ $callback = 'TestNamespace\TestClass::staticMethod';
+ $callback();
+
+ // Case should not matter.
+ $callback = 'testnamespace\testclass::staticmethod';
+ $callback();
+
+ $args = ['arg1', 'arg2', 'arg3'];
+ $callback = 'TestNamespace\TestClass::staticMethodWithArgs';
+
+ // Test call with args.
+ $callback($args[0], $args[1], $args[2]);
+
+ // Test call with splat operator.
+ $callback(...$args);
+}
+?>
+--EXPECT--
+Static method called!
+Static method called!
+Static method called with args: arg1, arg2, arg3
+Static method called with args: arg1, arg2, arg3
--- /dev/null
+--TEST--
+Indirect call with empty class and/or method name.
+--FILE--
+<?php
+class TestClass
+{
+ public static function __callStatic($method, array $args)
+ {
+ var_dump($method);
+ }
+}
+
+// Test call using array syntax
+$callback = ['TestClass', ''];
+$callback();
+
+// Test call using Class::method syntax.
+$callback = 'TestClass::';
+$callback();
+
+// Test array syntax with empty class name
+$callback = '::method';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test Class::method syntax with empty class name
+$callback = '::method';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test array syntax with empty class and method name
+$callback = ['', ''];
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test Class::method syntax with empty class and method name
+$callback = '::';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+?>
+--EXPECT--
+string(0) ""
+string(0) ""
+Class '' not found
+Class '' not found
+Class '' not found
+Class '' not found