1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/weakref/weakref.xml
Pedro Antonio Gil Rodríguez e06a98301e Traducción
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@326688 c90b9560-bf6c-de11-be94-00142212c4b1
2012-07-18 16:08:27 +00:00

124 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 2c3b121e72d2adc73cb2fa6d7aaf6f8ef470a5ad Maintainer: seros Status: ready -->
<!-- Reviewed: no -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.weakref" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>La clase WeakRef</title>
<titleabbrev>WeakRef</titleabbrev>
<partintro>
<!-- {{{ weakref intro -->
<section xml:id="weakref.intro">
&reftitle.intro;
<para>
La clase WeakRef proporciona una vía para objetos sin evitar que el recolector de basura libere tales objetos.
También proporciona una manera de convertir una referencia débil en una fuerte.
</para>
</section>
<!-- }}} -->
<section xml:id="weakref.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>WeakRef</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>WeakRef</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.weakref')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.weakref')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
</section>
<!-- {{{ weakref examples -->
<section xml:id="weakref.examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de uso de <classname>WeakRef</classname></title>
<programlisting role="php">
<![CDATA[
<?php
class MiClase {
public function __destruct() {
echo "¡Destruyendo el objeto!\n";
}
}
$o1 = new MiClase;
$r1 = new Weakref($o1);
if ($r1->valid()) {
echo "¡El objeto aún existe!\n";
var_dump($r1->get());
} else {
echo "¡El objeto está muerto!\n";
}
unset($o1);
if ($r1->valid()) {
echo "¡El objeto aún existe!\n";
var_dump($r1->get());
} else {
echo "¡El objeto está muerto!\n";
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
¡El objeto aún existe!
object(MiClase)#1 (0) {
}
¡Destruyendo el objeto!
¡El objeto está muerto!
]]>
</screen>
</example>
</para>
</section>
<!-- }}} -->
</partintro>
&reference.weakref.entities.weakref;
</phpdoc:classref>
<!-- 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
-->