summaryrefslogtreecommitdiff
path: root/tests/classes/tostring_003.phpt
blob: 87a5fe42e1b1ea8224eaa5361376c42b2de93897 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
ZE2 __toString() in __destruct/exception
--FILE--
<?php

class Test
{
    function __toString()
    {
        throw new Exception("Damn!");
        return "Hello\n";
    }

    function __destruct()
    {
        echo $this;
    }
}

try
{
    $o = new Test;
    $o = NULL;
}
catch(Exception $e)
{
    var_dump($e->getMessage());
}

?>
====DONE====
--EXPECT--
string(5) "Damn!"
====DONE====