xref: /PHP-8.1/Zend/tests/clone_002.phpt (revision 782352c5)
1--TEST--
2Testing multiple clone statements
3--FILE--
4<?php
5
6$a = clone clone $b = new stdClass;
7var_dump($a == $b);
8
9
10$c = clone clone clone $b = new stdClass;
11var_dump($a == $b, $b == $c);
12
13class foo { }
14
15$d = clone $a = $b = new foo;
16var_dump($a == $d, $b == $d, $c == $a);
17
18?>
19--EXPECT--
20bool(true)
21bool(true)
22bool(true)
23bool(true)
24bool(true)
25bool(false)
26