Skip to content

Commit d48b9a2

Browse files
authored
[PHP 8.4] Update WeakReference::__debugInfo() changelog に関する翻訳 (#236)
* Add more details about WeakReferences (#3976)の取り込み php/doc-en@cd391e6 * [PHP 8.4] Update WeakReference::__debugInfo() changelogを取り込み php/doc-en@7caf0c1
1 parent a7f3907 commit d48b9a2

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

language/predefined/weakreference.xml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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>
@@ -14,6 +14,10 @@
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> クラスはシリアライズできません。
@@ -51,11 +55,16 @@
5155
<programlisting role="php">
5256
<![CDATA[
5357
<?php
58+
5459
$obj = new stdClass;
5560
$weakref = WeakReference::create($obj);
61+
5662
var_dump($weakref->get());
63+
5764
unset($obj);
65+
5866
var_dump($weakref->get());
67+
5968
?>
6069
]]>
6170
</programlisting>
@@ -71,6 +80,30 @@ NULL
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;

0 commit comments

Comments
 (0)