jeroen Sun Oct 28 13:47:39 2001 EDT
Modified files:
/phpdoc/en/language types.xml
Log:
Add tip about investigating types of expressions to first page of types
section.
Index: phpdoc/en/language/types.xml
diff -u phpdoc/en/language/types.xml:1.54 phpdoc/en/language/types.xml:1.55
--- phpdoc/en/language/types.xml:1.54 Sun Oct 28 12:44:13 2001
+++ phpdoc/en/language/types.xml Sun Oct 28 13:47:39 2001
@@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
-<!-- $Revision: 1.54 $ -->
+<!-- $Revision: 1.55 $ -->
<chapter id="language.types">
<title>Types</title>
@@ -104,6 +104,20 @@
rather, it is decided at runtime by PHP depending on the context in
which that variable is used.
</simpara>
+ <tip>
+ <simpara>
+ If you want to check out the type and value of a certain <link
+ linkend="language.expressions">expression</link>, use
+ <function>var_dump</function>.
+ </simpara>
+ <simpara>
+ If you simply want a human-readable representation of the type for
+ debugging, use <function>gettype</function>. To check for a certain type,
+ do <emphasis>not</emphasis> use <function>gettype</function>, but use the
+ <literal>is_<replaceable>type</replaceable></literal> functions.
+ </simpara>
+ <!-- TODO: example(s) would be great -->
+ </tip>
<simpara>
If you would like to force a variable to be converted to a certain
type, you may either <link