printf("Static method called with args: %s, %s, %s\n", $arg1, $arg2, $arg3);
}
}
+}
+namespace CallNamespace
+{
// Test basic call using Class::method syntax.
$callback = 'TestNamespace\TestClass::staticMethod';
$callback();
$callback();
// Test array syntax with empty class name
-$callback = '::method';
+$callback = ['', 'method'];
try {
$callback();
} catch (Error $e) {
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
+
+// Test string ending in single colon
+$callback = 'Class:';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test string beginning in single colon
+$callback = ':method';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test single colon
+$callback = ':';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
?>
--EXPECT--
string(0) ""
Class '' not found
Class '' not found
Class '' not found
+Call to undefined function Class:()
+Call to undefined function :method()
+Call to undefined function :()