mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix PHP Version
Switch more files to the new layout git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183766 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
ef4fb9cd49
commit
dfa559fbf4
6 changed files with 232 additions and 74 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<refentry id="function.get-defined-vars">
|
||||
<refnamediv>
|
||||
<refname>get_defined_vars</refname>
|
||||
|
@ -72,7 +72,7 @@ print_r(array_keys(get_defined_vars()));
|
|||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5</entry>
|
||||
<entry>5.0.0</entry>
|
||||
<entry>
|
||||
The <varname>$GLOBALS</varname> variable is included in the results of
|
||||
the array returned.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/var.xml, last change in rev 1.75 -->
|
||||
<refentry id="function.get-resource-type">
|
||||
<refnamediv>
|
||||
|
@ -8,19 +8,49 @@
|
|||
Returns the resource type
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>get_resource_type</methodname>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function returns a string representing the type of the
|
||||
<type>resource</type> passed to it. If the parameter is not a valid
|
||||
<type>resource</type>, it generates an error.
|
||||
This function gets the type of the given resource.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>handle</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The evaluated resource handle.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
If the given <parameter>handle</parameter> is a resource, this function
|
||||
will return a string representing its type. If the type is not identified
|
||||
by this function, the return value will be the string
|
||||
<literal>Unknown</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
This function will return &false; and generate an error if
|
||||
<parameter>handle</parameter> is not a <type>resource</type>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>get_resource_type</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -38,7 +68,7 @@ echo get_resource_type($doc->doc) . "\n";
|
|||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/var.xml, last change in rev 1.19 -->
|
||||
<refentry id="function.is-resource">
|
||||
<refnamediv>
|
||||
|
@ -8,17 +8,40 @@
|
|||
Finds whether a variable is a resource
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_resource</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>is_resource</function> returns &true; if the variable
|
||||
given by the <parameter>var</parameter> parameter is a
|
||||
<type>resource</type>, otherwise it returns &false;.
|
||||
Finds whether the given variable is a resource.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>var</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The variable being evaluated.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &true; if <parameter>var</parameter> is a <type>resource</type>,
|
||||
&false; otherwise.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>using <function>is_resource</function></title>
|
||||
|
@ -36,11 +59,15 @@ if (!is_resource($db_link)) {
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See the documentation on the <type>resource</type>-type for
|
||||
more information, and
|
||||
<function>get_resource_type</function>.
|
||||
</para>
|
||||
<simplelist>
|
||||
<member>The <type>resource</type>-type documentation</member>
|
||||
<member><function>get_resource_type</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/var.xml, last change in rev 1.35 -->
|
||||
<refentry id="function.is-scalar">
|
||||
<refnamediv>
|
||||
|
@ -15,16 +15,50 @@
|
|||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>is_scalar</function> returns &true; if the variable
|
||||
given by the <parameter>var</parameter> parameter is a scalar,
|
||||
otherwise it returns &false;.
|
||||
Finds whether the given variable is a scalar.
|
||||
</para>
|
||||
<para>
|
||||
Scalar variables are those containing an <type>integer</type>,
|
||||
<type>float</type>, <type>string</type> or <type>boolean</type>.
|
||||
Types <type>array</type>, <type>object</type> and <type>resource</type>
|
||||
are not scalar.
|
||||
<informalexample>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>is_scalar</function> does not consider <type>resource</type>
|
||||
type values to be scalar as resources are abstract datatypes
|
||||
which are currently based on integers. This implementation detail should
|
||||
not be relied upon, as it may change.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>var</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The variable being evaluated.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &true; if <parameter>var</parameter> is a scalar &false;
|
||||
otherwise.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>is_scalar</function> example</title>
|
||||
<programlisting role="php">
|
||||
<!-- TODO: better example, this one can be quite misleading for unexperienced
|
||||
programmers. -->
|
||||
|
@ -42,40 +76,41 @@ $pi = 3.1416;
|
|||
$proteins = array("hemoglobin", "cytochrome c oxidase", "ferredoxin");
|
||||
|
||||
show_var($pi);
|
||||
// prints: 3.1416
|
||||
|
||||
show_var($proteins)
|
||||
// prints:
|
||||
// array(3) {
|
||||
// [0]=>
|
||||
// string(10) "hemoglobin"
|
||||
// [1]=>
|
||||
// string(20) "cytochrome c oxidase"
|
||||
// [2]=>
|
||||
// string(10) "ferredoxin"
|
||||
// }
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
3.1416
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(10) "hemoglobin"
|
||||
[1]=>
|
||||
string(20) "cytochrome c oxidase"
|
||||
[2]=>
|
||||
string(10) "ferredoxin"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>is_scalar</function> does not consider <type>resource</type>
|
||||
type values to be scalar as resources are abstract datatypes
|
||||
which are currently based on integers. This implementation detail should
|
||||
not be relied upon, as it may change.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>is_bool</function>,
|
||||
<function>is_numeric</function>,
|
||||
<function>is_float</function>,
|
||||
<function>is_int</function>,
|
||||
<function>is_real</function>,
|
||||
<function>is_string</function>,
|
||||
<function>is_object</function>, and
|
||||
<function>is_array</function>.
|
||||
<simplelist>
|
||||
<member><function>is_float</function></member>
|
||||
<member><function>is_int</function></member>
|
||||
<member><function>is_numeric</function></member>
|
||||
<member><function>is_real</function></member>
|
||||
<member><function>is_string</function></member>
|
||||
<member><function>is_bool</function></member>
|
||||
<member><function>is_object</function></member>
|
||||
<member><function>is_array</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/var.xml, last change in rev 1.84 -->
|
||||
<refentry id="function.var-dump">
|
||||
<refnamediv>
|
||||
|
@ -24,13 +24,37 @@
|
|||
returned in the output.
|
||||
</simpara>
|
||||
&tip.ob-capture;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>expression</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The variable you want to export.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>var_dump</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$a = array (1, 2, array ("a", "b", "c"));
|
||||
$a = array(1, 2, array("a", "b", "c"));
|
||||
var_dump($a);
|
||||
?>
|
||||
]]>
|
||||
|
@ -75,10 +99,15 @@ bool(true)
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>var_export</function> and
|
||||
<function>print_r</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>var_export</function></member>
|
||||
<member><function>print_r</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,29 +1,61 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/var.xml, last change in rev 1.6 -->
|
||||
<refentry id="function.var-export">
|
||||
<refnamediv>
|
||||
<refname>var_export</refname>
|
||||
<refpurpose>Outputs or returns a parsable string representation of a variable</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>var_export</methodname>
|
||||
<methodparam><type>mixed</type><parameter>expression</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>return</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
This function returns structured information about the variable that is
|
||||
passed to this function. It is similar to <function>var_dump</function>
|
||||
<function>var_export</function> gets structured information about the
|
||||
given variable. It is similar to <function>var_dump</function>
|
||||
with one exception: the returned representation is valid PHP code.
|
||||
</simpara>
|
||||
<simpara>
|
||||
You can also return the variable representation by using &true; as
|
||||
second parameter to this function.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<informalexample>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>expression</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The variable you want to export.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>return</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If used and set to &true;, <function>var_export</function> will return
|
||||
the variable representation instead of outputing it.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the variable representation when the <parameter>return</parameter>
|
||||
parameter is used and evaluates to &true;. Otherwise, this function will
|
||||
return &null;.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>var_export</function> Examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -64,12 +96,17 @@ echo $v;
|
|||
3.1
|
||||
]]>
|
||||
</screen>
|
||||
</informalexample>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>var_dump</function> and
|
||||
<function>print_r</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>var_dump</function></member>
|
||||
<member><function>print_r</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
Loading…
Reference in a new issue