diff options
Diffstat (limited to 'Zend/tests/dynamic_call_freeing.phpt')
-rw-r--r-- | Zend/tests/dynamic_call_freeing.phpt | 28 |
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 |