mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 08:28:54 +00:00
Document gc_status()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346688 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
5621e7baee
commit
b7c1306f08
3 changed files with 134 additions and 0 deletions
|
@ -18,6 +18,11 @@
|
|||
<function>array_key_last</function>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<function>gc_status</function>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<function>hrtime</function>
|
||||
|
|
128
reference/info/functions/gc-status.xml
Normal file
128
reference/info/functions/gc-status.xml
Normal file
|
@ -0,0 +1,128 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="function.gc-status" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>gc_status</refname>
|
||||
<refpurpose>Gets information about the garbage collector</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>gc_status</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets information about the current state of the garbage collector.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an associative array with the following elements:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>"runs"</literal>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>"collected"</literal>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>"threshold"</literal>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>"roots"</literal>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>gc_status</function> Usage</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// create object tree that needs gc collection
|
||||
$a = new stdClass();
|
||||
$a->b = [];
|
||||
for ($i = 0; $i < 100000; $i++) {
|
||||
$b = new stdClass();
|
||||
$b->a = $a;
|
||||
$a->b[] = $b;
|
||||
}
|
||||
unset($a);
|
||||
unset($b);
|
||||
gc_collect_cycles();
|
||||
|
||||
var_dump(gc_status());
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(4) {
|
||||
["runs"]=>
|
||||
int(5)
|
||||
["collected"]=>
|
||||
int(100002)
|
||||
["threshold"]=>
|
||||
int(50001)
|
||||
["roots"]=>
|
||||
int(0)
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><link linkend="features.gc">Garbage Collection</link></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- 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
|
||||
-->
|
|
@ -15,6 +15,7 @@
|
|||
<function name='gc_enable' from='PHP 5 >= 5.3.0, PHP 7'/>
|
||||
<function name='gc_enabled' from='PHP 5 >= 5.3.0, PHP 7'/>
|
||||
<function name='gc_mem_caches' from='PHP 7'/>
|
||||
<function name='gc_status' from='PHP 7 >= 7.3.0'/>
|
||||
<function name='get_cfg_var' from='PHP 4, PHP 5, PHP 7'/>
|
||||
<function name='get_current_user' from='PHP 4, PHP 5, PHP 7'/>
|
||||
<function name='get_defined_constants' from='PHP 4 >= 4.1.0, PHP 5, PHP 7'/>
|
||||
|
|
Loading…
Reference in a new issue