1
0
mirror of https://github.com/php/doc-pl.git synced 2026-03-25 15:42:11 +01:00
Files
archived-doc-pl/language/predefined/weakreference.xml
Maciej Sobaczewski 5b2225376d Sync with EN
2024-12-30 03:49:24 +01:00

135 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 7caf0c13762e7db3e7002b1286f23b65d940e2d0 Maintainer: grzesiek Status: ready -->
<!-- $Revision$ -->
<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">
<title>Klasa WeakReference</title>
<titleabbrev>WeakReference</titleabbrev>
<partintro>
<!-- {{{ WeakReference intro -->
<section xml:id="weakreference.intro">
&reftitle.intro;
<para>
Słabe referencje pozwalają programiście zachować odniesienie do obiektu, które
nie zapobiega jego zniszczeniu. Są one przydatne do implementacji struktur podobnych do pamięci podręcznej.
Jeśli oryginalny obiekt został zniszczony, podczas wywoływania metody <methodname>WeakReference::get</methodname>
zostanie zwrócona wartość &null;.
Oryginalny obiekt zostanie zniszczony, gdy wartość
<link linkend="features.gc.refcounting-basics">refcount</link> dla niego spadnie do zera;
tworzenie słabych referencji nie zwiększa wartości <literal>refcount</literal> obiektu, do którego się odwołujemy.
</para>
<para>
Klasy <classname>WeakReference</classname> nie mogą być serializowane.
</para>
</section>
<!-- }}} -->
<section xml:id="weakreference.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis class="class">
<ooclass>
<modifier>final</modifier>
<classname>WeakReference</classname>
</ooclass>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.weakreference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='WeakReference'])">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.weakreference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='WeakReference'])">
<xi:fallback/>
</xi:include>
</classsynopsis>
<!-- }}} -->
</section>
<section xml:id="weakreference.examples">
<title>Przykłady WeakReference</title>
<para>
<example xml:id="weakreference.basic-example">
<title>Podstawowe użycie WeakReference</title>
<programlisting role="php">
<![CDATA[
<?php
$obj = new stdClass();
$weakref = WeakReference::create($obj);
var_dump($weakref->get());
unset($obj);
var_dump($weakref->get());
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
object(stdClass)#1 (0) {
}
NULL
]]>
</screen>
</example>
</para>
</section>
<section role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Wyjście <methodname>WeakReference::__debugInfo</methodname> zawiera teraz
obiekt, do którego odnosi się WeakReference lub <literal>NULL</literal> jeżeli to odniesienie nie jest już
poprawne.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</partintro>
&language.predefined.weakreference.construct;
&language.predefined.weakreference.create;
&language.predefined.weakreference.get;
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->