summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_with_by_ref_message.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/exception_with_by_ref_message.phpt')
-rw-r--r--Zend/tests/exception_with_by_ref_message.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/exception_with_by_ref_message.phpt b/Zend/tests/exception_with_by_ref_message.phpt
new file mode 100644
index 0000000000..f15c3e2719
--- /dev/null
+++ b/Zend/tests/exception_with_by_ref_message.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Exception with by-ref message
+--FILE--
+<?php
+
+class MyException extends Exception
+{
+ public function __construct(&$msg) {
+ $this->message =& $msg;
+ }
+}
+
+$msg = 'Message';
+throw new MyException($msg);
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'MyException' with message 'Message' in %s:%d
+Stack trace:
+#0 {main}
+ thrown in %s on line %d