summaryrefslogtreecommitdiff
path: root/Zend/tests/dynamic_call_freeing.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/dynamic_call_freeing.phpt')
-rw-r--r--Zend/tests/dynamic_call_freeing.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Zend/tests/dynamic_call_freeing.phpt b/Zend/tests/dynamic_call_freeing.phpt
new file mode 100644
index 0000000000..d124009295
--- /dev/null
+++ b/Zend/tests/dynamic_call_freeing.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Freeing of function "name" when dynamic call fails
+--FILE--
+<?php
+
+try {
+ $bar = "bar";
+ ("foo" . $bar)();
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ $bar = ["bar"];
+ (["foo"] + $bar)();
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ (new stdClass)();
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+--EXPECT--
+Call to undefined function foobar()
+Function name must be a string
+Function name must be a string