mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
fix whitespaces + add role attribute to description section
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@187902 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
314fd3d36d
commit
e49b45eca8
1 changed files with 88 additions and 83 deletions
|
@ -1,65 +1,69 @@
|
|||
<?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.35 -->
|
||||
<refentry id="function.is-scalar">
|
||||
<refnamediv>
|
||||
<refname>is_scalar</refname>
|
||||
<refpurpose>
|
||||
Finds whether a variable is a scalar
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_scalar</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
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.
|
||||
</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">
|
||||
<refentry id="function.is-scalar">
|
||||
<refnamediv>
|
||||
<refname>is_scalar</refname>
|
||||
<refpurpose>
|
||||
Finds whether a variable is a scalar
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_scalar</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
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.
|
||||
</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. -->
|
||||
<![CDATA[
|
||||
|
@ -80,9 +84,9 @@ show_var($proteins)
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
3.1416
|
||||
array(3) {
|
||||
|
@ -94,26 +98,27 @@ array(3) {
|
|||
string(10) "ferredoxin"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<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>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<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>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
Loading…
Reference in a new issue