File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<!-- $Revision$ -->
3- <!-- EN-Revision: 14767af0f05dffa6fdb9b49e1a1f4e9ca7022a60 Maintainer: mumumu Status: ready -->
3+ <!-- EN-Revision: 7caf0c13762e7db3e7002b1286f23b65d940e2d0 Maintainer: mumumu Status: ready -->
44<reference xml : id =" class.weakreference" role =" class" xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" xmlns : xi =" http://www.w3.org/2001/XInclude" >
55
66 <title >WeakReference クラス</title >
1414 <para >
1515 弱い参照により、オブジェクトが破棄されるのを妨げないオブジェクトへの参照を保持することが可能です。
1616 この機能は、キャッシュのようなデータ構造を実装するのに役立ちます。
17+ 元のオブジェクトが破棄されている場合、<methodname >WeakReference::get</methodname >
18+ メソッドを呼び出すと &null; を返します。
19+ 元のオブジェクトは、<link linkend =" features.gc.refcounting-basics" >refcount</link > が 0 になると破棄されます。
20+ 弱い参照を作成しても、参照されているオブジェクトの <literal >refcount</literal > は増加しません。
1721 </para >
1822 <para >
1923 <classname >WeakReference</classname > クラスはシリアライズできません。
5155 <programlisting role =" php" >
5256<![CDATA[
5357<?php
58+
5459$obj = new stdClass;
5560$weakref = WeakReference::create($obj);
61+
5662var_dump($weakref->get());
63+
5764unset($obj);
65+
5866var_dump($weakref->get());
67+
5968?>
6069]]>
6170 </programlisting >
7180 </para >
7281 </section >
7382
83+ <section role =" changelog" >
84+ &reftitle.changelog;
85+ <informaltable >
86+ <tgroup cols =" 2" >
87+ <thead >
88+ <row >
89+ <entry >&Version; </entry >
90+ <entry >&Description; </entry >
91+ </row >
92+ </thead >
93+ <tbody >
94+ <row >
95+ <entry >8.4.0</entry >
96+ <entry >
97+ <methodname >WeakReference::__debugInfo</methodname > の出力に、
98+ 参照されたオブジェクトを含むようになりました。また、参照が有効ではなくなっている場合は、
99+ 参照されたオブジェクトは <literal >NULL</literal > となります。
100+ </entry >
101+ </row >
102+ </tbody >
103+ </tgroup >
104+ </informaltable >
105+ </section >
106+
74107 </partintro >
75108
76109 &language.predefined.weakreference.construct;
You can’t perform that action at this time.
0 commit comments