summaryrefslogtreecommitdiff
path: root/Zend/tests/methods-on-non-objects-nested-calls-static.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/methods-on-non-objects-nested-calls-static.phpt')
-rwxr-xr-xZend/tests/methods-on-non-objects-nested-calls-static.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/methods-on-non-objects-nested-calls-static.phpt b/Zend/tests/methods-on-non-objects-nested-calls-static.phpt
new file mode 100755
index 0000000000..9e969b7d68
--- /dev/null
+++ b/Zend/tests/methods-on-non-objects-nested-calls-static.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Catch method calls on non-objects with nested calls to static methods
+--FILE--
+<?php
+class Nesting {
+ static function nested() {
+ throw new LogicException('Should not be called');
+ }
+}
+set_error_handler(function($code, $message) {
+ static $i= 0;
+ echo 'Called #'.(++$i)."\n";
+});
+
+$x= null;
+var_dump($x->method(Nesting::nested()));
+echo "Alive\n";
+?>
+--EXPECTF--
+Called #1
+NULL
+Alive