xref: /PHP-7.4/tests/classes/tostring_002.phpt (revision 782352c5)
1--TEST--
2ZE2 __toString() in __destruct
3--FILE--
4<?php
5
6class Test
7{
8	function __toString()
9	{
10		return "Hello\n";
11	}
12
13	function __destruct()
14	{
15		echo $this;
16	}
17}
18
19$o = new Test;
20$o = NULL;
21
22$o = new Test;
23
24?>
25====DONE====
26--EXPECT--
27Hello
28====DONE====
29Hello
30