mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Added documentation for the get_resource_id function
Closes GH-227. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351584 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a1799ec0bd
commit
ac20506c2a
3 changed files with 118 additions and 0 deletions
108
reference/var/functions/get-resource-id.xml
Normal file
108
reference/var/functions/get-resource-id.xml
Normal file
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry xml:id="function.get-resource-id" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>get_resource_id</refname>
|
||||
<refpurpose>
|
||||
Returns an integer identifier for the given resource
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>get_resource_id</methodname>
|
||||
<methodparam><type>resource</type><parameter>res</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function provides a type-safe way for generating the integer identifier
|
||||
for a resource.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>res</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The evaluated resource handle.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The <type>int</type> identifier for the given <parameter>res</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
This function is essentially an <type>int</type> cast of
|
||||
<parameter>res</parameter> to make it easier to retrieve the resource ID.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>get_resource_id</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$handle = fopen('./storage/logs/lumen.log', 'rt');
|
||||
|
||||
echo (int) $handle . "\n\n";
|
||||
|
||||
echo get_resource_id($handle);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
698
|
||||
|
||||
698
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>get_resource_type</function></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
|
||||
-->
|
|
@ -75,6 +75,15 @@ echo get_resource_type($doc->doc) . "\n";
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>get_resource_id</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<function name='empty' from='PHP 4, PHP 5, PHP 7'/>
|
||||
<function name='floatval' from='PHP 4 >= 4.2.0, PHP 5, PHP 7'/>
|
||||
<function name='get_defined_vars' from='PHP 4 >= 4.0.4, PHP 5, PHP 7'/>
|
||||
<function name='get_resource_id' from='PHP 8'/>
|
||||
<function name='get_resource_type' from='PHP 4 >= 4.0.2, PHP 5, PHP 7'/>
|
||||
<function name='gettype' from='PHP 4, PHP 5, PHP 7'/>
|
||||
<function name='intval' from='PHP 4, PHP 5, PHP 7'/>
|
||||
|
|
Loading…
Reference in a new issue