jeroen Fri Sep 21 19:35:51 2001 EDT
Modified files:
/phpdoc/en/functions var.xml
Log:
Document floatval as the main function, doubleval as the alias.
Index: phpdoc/en/functions/var.xml
diff -u phpdoc/en/functions/var.xml:1.65 phpdoc/en/functions/var.xml:1.66
--- phpdoc/en/functions/var.xml:1.65 Fri Sep 21 18:47:48 2001
+++ phpdoc/en/functions/var.xml Fri Sep 21 19:35:51 2001
@@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
-<!-- $Revision: 1.65 $ -->
+<!-- $Revision: 1.66 $ -->
<reference id="ref.var">
<title>Variable Functions</title>
<titleabbrev>Variables</titleabbrev>
@@ -7,37 +7,21 @@
<refentry id="function.doubleval">
<refnamediv>
<refname>doubleval</refname>
- <refpurpose>Get double value of a variable</refpurpose>
+ <refpurpose>Alias of <function>floatval</function></refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>float <function>doubleval</function></funcdef>
- <paramdef>mixed <parameter>var</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <simpara>
- Returns the double (floating point) value of
- <parameter>var</parameter>.
- </simpara>
<para>
- <parameter>Var</parameter> may be any scalar type. You cannot use
- <function>doubleval</function> on arrays or objects.
- <informalexample>
- <programlisting role="php">
-$var = '122.34343The';
-$double_value_of_var = doubleval ($var);
-print $double_value_of_var; // prints 122.34343
- </programlisting>
- </informalexample>
+ This function is an alias of <function>floatval</function>.
</para>
- <simpara>
- See also <function>intval</function>,
- <function>strval</function>, <function>settype</function> and
- <link linkend="language.types.type-juggling">Type
- juggling</link>.
- </simpara>
+ <note>
+ <para>
+ This alias is a left-over from a function-renaming. In older versions of
+ PHP you'll need to use this alias of the <function>floatval</function>
+ function, because <function>floatval</function> wasn't yet available in
+ that version.
+ </para>
+ </note>
</refsect1>
</refentry>
@@ -98,6 +82,42 @@
</refsect1>
</refentry>
+ <refentry id="function.floatval">
+ <refnamediv>
+ <refname>floatval</refname>
+ <refpurpose>Get float value of a variable</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>float <function>floatval</function></funcdef>
+ <paramdef>mixed <parameter>var</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <simpara>
+ Returns the <type>float</type> value of <parameter>var</parameter>.
+ </simpara>
+ <para>
+ <parameter>Var</parameter> may be any scalar type. You cannot use
+ <function>floatval</function> on arrays or objects.
+ <informalexample>
+ <programlisting role="php">
+$var = '122.34343The';
+$float_value_of_var = floatval ($var);
+print $float_value_of_var; // prints 122.34343
+ </programlisting>
+ </informalexample>
+ </para>
+ <simpara>
+ See also <function>intval</function>,
+ <function>strval</function>, <function>settype</function> and
+ <link linkend="language.types.type-juggling">Type
+ juggling</link>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
<refentry id="function.gettype">
<refnamediv>
<refname>gettype</refname>
@@ -304,7 +324,7 @@
</para>
</note>
<simpara>
- See also <function>doubleval</function>,
+ See also <function>floatval</function>,
<function>strval</function>, <function>settype</function> and
<link linkend="language.types.type-juggling">Type
juggling</link>.
@@ -1008,7 +1028,9 @@
<itemizedlist>
<listitem><simpara>"boolean"</simpara></listitem>
<listitem><simpara>"integer"</simpara></listitem>
- <listitem><simpara>"double"</simpara></listitem>
+ <listitem><simpara>"double" (this is for historical reasons only,
+ "double" will be returned when the type is
+ <type>float</type>.</simpara></listitem>
<listitem><simpara>"string"</simpara></listitem>
<listitem><simpara>"array"</simpara></listitem>
<listitem><simpara>"object"</simpara></listitem>
@@ -1061,7 +1083,7 @@
<function>strval</function> on arrays or objects.
</simpara>
<simpara>
- See also <function>doubleval</function>,
+ See also <function>floatval</function>,
<function>intval</function>, <function>settype</function> and
<link linkend="language.types.type-juggling">Type
juggling</link>.