derick Fri May 24 14:46:16 2002 EDT
Modified files:
/phpdoc/en/reference/var/functions isset.xml
Log:
- Update isset() docs (also fixes bug #17395)
Index: phpdoc/en/reference/var/functions/isset.xml
diff -u phpdoc/en/reference/var/functions/isset.xml:1.2
phpdoc/en/reference/var/functions/isset.xml:1.3
--- phpdoc/en/reference/var/functions/isset.xml:1.2 Wed Apr 17 02:44:58 2002
+++ phpdoc/en/reference/var/functions/isset.xml Fri May 24 14:46:15 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.2 -->
<refentry id="function.isset">
<refnamediv>
@@ -20,31 +20,46 @@
</para>
</note>
<simpara>
- Returns &true; if <parameter>var</parameter>
- exists; &false; otherwise.
+ Returns &true; if <parameter>var</parameter> exists; &false; otherwise.
</simpara>
<para>
- If a variable has been unset with <function>unset</function>,
- it will no longer be <function>isset</function>. <function>isset</function>
- will return &false; if testing a variable that has been
- set to &null;. Also note that a &null; byte (<literal>"\0"</literal>)
- is not equivalent to the PHP &null; constant.
+ If a variable has been unset with <function>unset</function>, it will no
+ longer be <function>isset</function>. <function>isset</function> will
+ return &false; if testing a variable that has been set to &null;. Also
+ note that a &null; byte (<literal>"\0"</literal>) is not equivalent to
+ the PHP &null; constant.
<informalexample>
<programlisting role="php">
<![CDATA[
-$a = "test";
-$b = "anothertest";
+<?php
+ $a = "test";
+ $b = "anothertest";
-echo isset ($a); // TRUE
-echo isset ($a, $b) //TRUE
+ echo isset ($a); // TRUE
+ echo isset ($a, $b); //TRUE
-unset ($a);
-echo isset ($a); // FALSE
-echo isset ($a, $b); //FALSE
+ unset ($a);
+ echo isset ($a); // FALSE
+ echo isset ($a, $b); //FALSE
$foo = NULL;
-print isset ($foo); // FALSE
+ print isset ($foo); // FALSE
+?>
+]]>
+ </programlisting>
+ </informalexample>
+ </para>
+ <para>
+ This also work for elements in arrays:
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $a = array ('test' => 1);
+ echo isset ($a['test']); // TRUE
+ echo isset ($a['foo']); // FALSE
+?>
]]>
</programlisting>
</informalexample>