summaryrefslogtreecommitdiff
path: root/tests/classes/tostring_003.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/classes/tostring_003.phpt')
-rw-r--r--tests/classes/tostring_003.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt
new file mode 100644
index 0000000..8815bd9
--- /dev/null
+++ b/tests/classes/tostring_003.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 __toString() in __destruct/exception
+--FILE--
+<?php
+
+class Test
+{
+ function __toString()
+ {
+ throw new Exception("Damn!");
+ return "Hello\n";
+ }
+
+ function __destruct()
+ {
+ echo $this;
+ }
+}
+
+try
+{
+ $o = new Test;
+ $o = NULL;
+}
+catch(Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+?>
+====DONE====
+--EXPECTF--
+Fatal error: Method Test::__toString() must not throw an exception in %stostring_003.php on line %d