Annotation of embedaddon/php/Zend/tests/bug26698.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter crash PHP)
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: ini_set("report_memleaks", 0);  // the exception thrown in this test results in a memory leak, which is fine
        !             7: 
        !             8: class Object
        !             9: {
        !            10:        function getNone()
        !            11:        {
        !            12:                throw new Exception('NONE');
        !            13:        }
        !            14: }
        !            15: 
        !            16: class Proxy
        !            17: {
        !            18:        function three($a, $b, $c)
        !            19:        {
        !            20:        }
        !            21: 
        !            22:        function callOne()
        !            23:        {
        !            24:                try
        !            25:                {
        !            26:                        $res = new Object();
        !            27:                        $this->three($res->getNone());
        !            28:                }
        !            29:                catch(Exception $e)
        !            30:                {
        !            31:                        echo 'Caught: '.$e->getMessage()."\n";
        !            32:                }
        !            33:        }
        !            34: 
        !            35:        function callTwo()
        !            36:        {
        !            37:                try
        !            38:                {
        !            39:                        $res = new Object();
        !            40:                        $this->three(1, $res->getNone());
        !            41:                }
        !            42:                catch(Exception $e)
        !            43:                {
        !            44:                        echo 'Caught: '.$e->getMessage()."\n";
        !            45:                }
        !            46:        }
        !            47: 
        !            48:        function callThree()
        !            49:        {
        !            50:                try
        !            51:                {
        !            52:                        $res = new Object();
        !            53:                        $this->three(1, 2, $res->getNone());
        !            54:                }
        !            55:                catch(Exception $e)
        !            56:                {
        !            57:                        echo 'Caught: '.$e->getMessage()."\n";
        !            58:                }
        !            59:        }
        !            60: }
        !            61: 
        !            62: $p = new Proxy();
        !            63: 
        !            64: $p->callOne();
        !            65: $p->callTwo();
        !            66: $p->callThree();
        !            67: ?>
        !            68: ===DONE===
        !            69: --EXPECT--
        !            70: Caught: NONE
        !            71: Caught: NONE
        !            72: Caught: NONE
        !            73: ===DONE===

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