summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Friebe <thekid@thekid.de>2014-04-28 21:48:08 +0200
committerTimm Friebe <thekid@thekid.de>2014-04-28 21:48:08 +0200
commit7041ef44a6c18bb8d76dc5cf17d20ec00367d24b (patch)
tree8315b3cfaaad993533c8caf8f2bab9adc1ec15d2
parentda1db5e688c46a044bc0745c86cc34cc4e9ab808 (diff)
downloadphp-git-7041ef44a6c18bb8d76dc5cf17d20ec00367d24b.tar.gz
Add tests verifying method calls on non-objects work inside eval()
-rw-r--r--Zend/tests/methods-on-non-objects-eval.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/tests/methods-on-non-objects-eval.phpt b/Zend/tests/methods-on-non-objects-eval.phpt
new file mode 100644
index 0000000000..c961ed385f
--- /dev/null
+++ b/Zend/tests/methods-on-non-objects-eval.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Indirect call inside eval to member function on non-object
+--FILE--
+<?php
+set_error_handler(function($code, $message) {
+ var_dump($code, $message);
+});
+
+$x= null;
+var_dump(eval('$x->method(1, 2, 3);'));
+echo "Alive\n";
+?>
+--EXPECTF--
+
+int(4096)
+string(%d) "Call to a member function method() on a non-object"
+NULL
+Alive