goba Sun Apr 22 02:31:04 2001 EDT
Modified files:
/phpdoc/en/functions var.xml
Log:
Corrections to settype():
o] The return type is boolen
o] The first param is type of mixed
o] Missing boolean type from the list
o] Added two examples
Index: phpdoc/en/functions/var.xml
diff -u phpdoc/en/functions/var.xml:1.41 phpdoc/en/functions/var.xml:1.42
--- phpdoc/en/functions/var.xml:1.41 Mon Mar 19 01:58:57 2001
+++ phpdoc/en/functions/var.xml Sun Apr 22 02:31:03 2001
@@ -903,8 +903,8 @@
<title>Description</title>
<funcsynopsis>
<funcprototype>
- <funcdef>int <function>settype</function></funcdef>
- <paramdef>string <parameter>var</parameter></paramdef>
+ <funcdef>boolean <function>settype</function></funcdef>
+ <paramdef>mixed <parameter>var</parameter></paramdef>
<paramdef>string <parameter>type</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@@ -915,6 +915,7 @@
<para>
Possibles values of <parameter>type</parameter> are:
<itemizedlist>
+ <listitem><simpara>"boolean"</simpara></listitem>
<listitem><simpara>"integer"</simpara></listitem>
<listitem><simpara>"double"</simpara></listitem>
<listitem><simpara>"string"</simpara></listitem>
@@ -924,6 +925,18 @@
</para>
<para>
Returns true if successful; otherwise returns false.
+ </para>
+ <para>
+ <example>
+ <title><function>settype</function> example</title>
+ <programlisting role="php">
+$foo = "5bar"; // string
+$bar = true; // boolean
+
+settype($foo, "integer"); // $foo is now 5 (integer)
+settype($bar, "string"); // $bar is now "1" (string)
+ </programlisting>
+ </example>
</para>
<para>
See also <function>gettype</function>.