summaryrefslogtreecommitdiff
path: root/Zend/tests/methods-on-non-objects-chain.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/methods-on-non-objects-chain.phpt')
-rw-r--r--Zend/tests/methods-on-non-objects-chain.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/methods-on-non-objects-chain.phpt b/Zend/tests/methods-on-non-objects-chain.phpt
new file mode 100644
index 0000000000..30da254cd5
--- /dev/null
+++ b/Zend/tests/methods-on-non-objects-chain.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Catch chained method calls on non-objects raise recoverable errors
+--FILE--
+<?php
+set_error_handler(function($code, $message) {
+ var_dump($code, $message);
+});
+
+$x= null;
+var_dump($x->method()->chained()->invocations());
+echo "Alive\n";
+?>
+--EXPECTF--
+
+int(4096)
+string(%d) "Call to a member function method() on null"
+int(4096)
+string(%d) "Call to a member function chained() on null"
+int(4096)
+string(%d) "Call to a member function invocations() on null"
+NULL
+Alive