xref: /PHP-5.5/tests/classes/tostring_002.phpt (revision 610c7fbe)
1--TEST--
2ZE2 __toString() in __destruct
3--SKIPIF--
4<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
5--FILE--
6<?php
7
8class Test
9{
10	function __toString()
11	{
12		return "Hello\n";
13	}
14
15	function __destruct()
16	{
17		echo $this;
18	}
19}
20
21$o = new Test;
22$o = NULL;
23
24$o = new Test;
25
26?>
27====DONE====
28--EXPECTF--
29Hello
30====DONE====
31Hello
32