summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/tests/indirect_call_string_001.phpt3
-rw-r--r--Zend/tests/indirect_call_string_002.phpt29
2 files changed, 31 insertions, 1 deletions
diff --git a/Zend/tests/indirect_call_string_001.phpt b/Zend/tests/indirect_call_string_001.phpt
index 4493d6b3b8..9151de717b 100644
--- a/Zend/tests/indirect_call_string_001.phpt
+++ b/Zend/tests/indirect_call_string_001.phpt
@@ -16,7 +16,10 @@ namespace TestNamespace
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();
diff --git a/Zend/tests/indirect_call_string_002.phpt b/Zend/tests/indirect_call_string_002.phpt
index 40c913ac4c..ecb0b6d80f 100644
--- a/Zend/tests/indirect_call_string_002.phpt
+++ b/Zend/tests/indirect_call_string_002.phpt
@@ -19,7 +19,7 @@ $callback = 'TestClass::';
$callback();
// Test array syntax with empty class name
-$callback = '::method';
+$callback = ['', 'method'];
try {
$callback();
} catch (Error $e) {
@@ -49,6 +49,30 @@ try {
} 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) ""
@@ -57,3 +81,6 @@ Class '' not found
Class '' not found
Class '' not found
Class '' not found
+Call to undefined function Class:()
+Call to undefined function :method()
+Call to undefined function :()