File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug53511.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:36 2012 UTC (12 years, 10 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

    1: --TEST--
    2: Bug #53511 (Exceptions are lost in case an exception is thrown in catch operator)
    3: --FILE--
    4: <?php
    5: class Foo {
    6: 	function __destruct() {
    7: 		throw new Exception("ops 1");
    8: 	}
    9: }
   10: 
   11: function test() {
   12: 	$e = new Foo();
   13: 	try {
   14: 		throw new Exception("ops 2");
   15: 	} catch (Exception $e) {
   16: 		echo $e->getMessage()."\n";
   17: 	}
   18: }
   19: 
   20: test();
   21: echo "bug\n";
   22: --EXPECTF--
   23: Fatal error: Uncaught exception 'Exception' with message 'ops 2' in %sbug53511.php:11
   24: Stack trace:
   25: #0 %sbug53511.php(17): test()
   26: #1 {main}
   27: 
   28: Next exception 'Exception' with message 'ops 1' in %sbug53511.php:4
   29: Stack trace:
   30: #0 %sbug53511.php(12): Foo->__destruct()
   31: #1 %sbug53511.php(17): test()
   32: #2 {main}
   33:   thrown in %sbug53511.php on line 4

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>