summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/throw_not_an_exception.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/generators/throw_not_an_exception.phpt')
-rw-r--r--Zend/tests/generators/throw_not_an_exception.phpt15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zend/tests/generators/throw_not_an_exception.phpt b/Zend/tests/generators/throw_not_an_exception.phpt
new file mode 100644
index 0000000000..d93903e215
--- /dev/null
+++ b/Zend/tests/generators/throw_not_an_exception.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Generator::throw() with something that's not an exception
+--FILE--
+<?php
+
+function gen() {
+ yield;
+}
+
+$gen = gen();
+$gen->throw(new stdClass);
+
+?>
+--EXPECTF--
+Fatal error: Exceptions must be valid objects derived from the Exception base class in %s on line %d