reference/var/functions/isset.xml
8cdc6621f9826d04abc3e50438c010804d7e8683
...
...
@@ -3,7 +3,7 @@
3
3
<refentry xml:id="function.isset" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>isset</refname>
6
-
<refpurpose>Determine if a variable is set and is not &null;</refpurpose>
6
+
<refpurpose>Determine if a variable is declared and is different than &null;</refpurpose>
7
7
</refnamediv>
8
8
9
9
<refsect1 role="description">
...
...
@@ -11,21 +11,27 @@
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>isset</methodname>
13
13
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
14
-
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
14
+
<methodparam rep="repeat"><type>mixed</type><parameter>vars</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
-
Determine if a variable is set and is not &null;.
17
+
Determine if a variable is considered set,
18
+
this means if a variable is declared and is different than &null;.
18
19
</para>
19
20
<para>
20
-
If a variable has been unset with <function>unset</function>, it will no
21
-
longer be set. <function>isset</function> will return &false; if testing a
22
-
variable that has been set to &null;. Also note that a null character
23
-
(<literal>"\0"</literal>) is not equivalent to the PHP &null; constant.
21
+
If a variable has been unset with the <function>unset</function>
22
+
function, it is no longer considered to be set.
24
23
</para>
25
24
<para>
26
-
If multiple parameters are supplied then <function>isset</function> will
27
-
return &true; only if all of the parameters are set. Evaluation goes from
28
-
left to right and stops as soon as an unset variable is encountered.
25
+
<function>isset</function> will return &false; when checking a
26
+
variable that has been assigned to &null;.
27
+
Also note that a null character (<literal>"\0"</literal>) is not
28
+
equivalent to the PHP &null; constant.
29
+
</para>
30
+
<para>
31
+
If multiple parameters are supplied then <function>isset</function>
32
+
will return &true; only if all of the parameters are considered set.
33
+
Evaluation goes from left to right and stops as soon as an unset
34
+
variable is encountered.
29
35
</para>
30
36
</refsect1>
31
37

...
...
@@ -42,10 +48,10 @@
42
48
</listitem>
43
49
</varlistentry>
44
50
<varlistentry>
45
-
<term><parameter>...</parameter></term>
51
+
<term><parameter>vars</parameter></term>
46
52
<listitem>
47
53
<para>
48
-
Another variable ...
54
+
Further variables.
49
55
</para>
50
56
</listitem>
51
57
</varlistentry>
...
...
@@ -56,34 +62,8 @@
56
62
<refsect1 role="returnvalues">
57
63
&reftitle.returnvalues;
58
64
<para>
59
-
Returns &true; if <parameter>var</parameter> exists and has value other
60
-
than &null;, &false; otherwise.
61
-
</para>
62
-
</refsect1>
63
-

64
-
<refsect1 role="changelog">
65
-
&reftitle.changelog;
66
-
<para>
67
-
<informaltable>
68
-
<tgroup cols="2">
69
-
<thead>
70
-
<row>
71
-
<entry>&Version;</entry>
72
-
<entry>&Description;</entry>
73
-
</row>
74
-
</thead>
75
-
<tbody>
76
-
<row>
77
-
<entry>5.4.0</entry>
78
-
<entry>
79
-
<para>
80
-
Checking non-numeric offsets of strings now returns &false;.
81
-
</para>
82
-
</entry>
83
-
</row>
84
-
</tbody>
85
-
</tgroup>
86
-
</informaltable>
65
+
Returns &true; if <parameter>var</parameter> exists and has
66
+
any value other than &null;. &false; otherwise.
87
67
</para>
88
68
</refsect1>
89
69

...
...
@@ -154,10 +134,6 @@ var_dump(isset($a['cake']['a']['b'])); // FALSE
154
134
</para>
155
135
<example>
156
136
<title><function>isset</function> on String Offsets</title>
157
-
<para>
158
-
PHP 5.4 changes how <function>isset</function> behaves
159
-
when passed string offsets.
160
-
</para>
161
137
<programlisting role="php">
162
138
<![CDATA[
163
139
<?php
...
...
@@ -171,18 +147,7 @@ var_dump(isset($expected_array_got_string['0 Mostel']));
171
147
?>
172
148
]]>
173
149
</programlisting>
174
-
&example.outputs.53;
175
-
<screen>
176
-
<![CDATA[
177
-
bool(true)
178
-
bool(true)
179
-
bool(true)
180
-
bool(true)
181
-
bool(true)
182
-
bool(true)
183
-
]]>
184
-
</screen>
185
-
&example.outputs.54;
150
+
&example.outputs;
186
151
<screen>
187
152
<![CDATA[
188
153
bool(false)
189
154