Annotation of embedaddon/php/Zend/tests/bug52361.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #52361 (Throwing an exception in a destructor causes invalid catching)
                      3: --FILE--
                      4: <?php
                      5: class aaa {
                      6:        public function __destruct() {
                      7:                try {
                      8:                        throw new Exception(__CLASS__);
                      9:                } catch(Exception $ex) {
                     10:                        echo "1. $ex\n";
                     11:                }
                     12:        }
                     13: }
                     14: function bbb() {
                     15:        $a = new aaa();
                     16:        throw new Exception(__FUNCTION__);
                     17: }
                     18: try {
                     19:        bbb();
                     20:        echo "must be skipped !!!";
                     21: } catch(Exception $ex) {
                     22:        echo "2. $ex\n";
                     23: }
                     24: ?>
                     25: --EXPECTF--
                     26: 1. exception 'Exception' with message 'aaa' in %sbug52361.php:5
                     27: Stack trace:
                     28: #0 %sbug52361.php(16): aaa->__destruct()
                     29: #1 %sbug52361.php(16): bbb()
                     30: #2 {main}
                     31: 2. exception 'Exception' with message 'bbb' in %sbug52361.php:13
                     32: Stack trace:
                     33: #0 %sbug52361.php(16): bbb()
                     34: #1 {main}
                     35: 

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