philip Thu Jan 3 13:42:29 2002 EDT
Modified files:
/phpdoc/en/functions var.xml
Log:
is_scalar: Removed note, hid TODO comment, added some info.
Regarding TODO, not sure about it, can't think of a better example atm.
Index: phpdoc/en/functions/var.xml
diff -u phpdoc/en/functions/var.xml:1.89 phpdoc/en/functions/var.xml:1.90
--- phpdoc/en/functions/var.xml:1.89 Tue Jan 1 15:38:06 2002
+++ phpdoc/en/functions/var.xml Thu Jan 3 13:42:29 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.89 $ -->
+<!-- $Revision: 1.90 $ -->
<reference id="ref.variables">
<title>Variable Functions</title>
<titleabbrev>Variables</titleabbrev>
@@ -745,20 +745,21 @@
</para>
<para>
Scalar variables are those containing an <type>integer</type>,
- <type>float</type>, <type>string</type> or <type>boolean</type>.
- For example:
+ <type>float</type>, <type>string</type> or <type>boolean</type>.
+ Types <type>array</type>, <type>object</type> and <type>resource</type>
+ or not scalar.
<informalexample>
<programlisting role="php">
-<![CDATA[
<!-- TODO: better example, this one can be quite misleading for unexperienced
- programmers -->
+ programmers. -->
+<![CDATA[
function show_var($var) {
- if (is_scalar($var))
+ if (is_scalar($var)) {
echo $var;
- else
+ } else {
var_dump($var);
+ }
}
-
$pi = 3.1416;
$proteins = array("hemoglobin", "cytochrome c oxidase", "ferredoxin");
@@ -782,15 +783,9 @@
<note>
<para>
<function>is_scalar</function> does not consider <type>resource</type>
- type values to be scalar values. This behavior is intentional:
- Resources are abstract datatypes which are currently based on
- integers. This implementation detail should not be relied upon,
- as it may change.
- </para>
- </note>
- <note>
- <para>
- Since 4.0.5
+ 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>
<para>