summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_004.phpt
blob: cc9990c386bfce7fa8459dcdcd3eb43091ed1b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Throwing exception using a class that isn't derived from the Exception base class
--FILE--
<?php 

error_reporting(E_ALL|E_STRICT);

class Foo { }

try {
	throw new Foo();
} catch (Foo $e) {
	var_dump($e);
}

?>
--EXPECTF--
Fatal error: Uncaught exception 'EngineException' with message 'Exceptions must be valid objects derived from the Exception base class' in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d