summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Friebe <thekid@thekid.de>2014-04-20 12:47:18 +0200
committerTimm Friebe <thekid@thekid.de>2014-04-20 12:47:18 +0200
commita86e7621666bce5dcf5ac3304b2384b254319025 (patch)
tree94304d270c4562619937fd87541cbed895f42fb6
parent51a5e184335373e0bcfd6c65fdb22c6908768a83 (diff)
downloadphp-git-a86e7621666bce5dcf5ac3304b2384b254319025.tar.gz
Add test verifying chained method invocations
-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..0f299469e2
--- /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 a non-object"
+int(4096)
+string(%d) "Call to a member function chained() on a non-object"
+int(4096)
+string(%d) "Call to a member function invocations() on a non-object"
+NULL
+Alive