1--TEST--
2WeakReference
3--FILE--
4<?php
5$std = new stdClass;
6
7debug_zval_dump($std);
8
9$wr = WeakReference::create($std);
10$wr2 = WeakReference::create($std);
11
12debug_zval_dump($std);
13
14var_dump($wr, $wr2);
15
16debug_zval_dump($wr->get());
17debug_zval_dump($wr2->get());
18
19unset($std);
20
21debug_zval_dump($wr->get());
22debug_zval_dump($wr2->get());
23?>
24--EXPECT--
25object(stdClass)#1 (0) refcount(2){
26}
27object(stdClass)#1 (0) refcount(2){
28}
29object(WeakReference)#2 (1) {
30  ["object"]=>
31  object(stdClass)#1 (0) {
32  }
33}
34object(WeakReference)#2 (1) {
35  ["object"]=>
36  object(stdClass)#1 (0) {
37  }
38}
39object(stdClass)#1 (0) refcount(2){
40}
41object(stdClass)#1 (0) refcount(2){
42}
43NULL
44NULL
45