reference/var/functions/is-bool.xml
0c9c2dd669fe9395eaa73d487fbd160f9057429a
...
...
@@ -1,4 +1,4 @@
1
-
<?xml version="1.0" encoding="iso-8859-1"?>
1
+
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
3
<refentry xml:id="function.is-bool" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
...
...
@@ -11,7 +11,7 @@
11
11
&reftitle.description;
12
12
<methodsynopsis>
13
13
<type>bool</type><methodname>is_bool</methodname>
14
-
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
14
+
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Finds whether the given variable is a boolean.
...
...
@@ -22,7 +22,7 @@
22
22
<para>
23
23
<variablelist>
24
24
<varlistentry>
25
-
<term><parameter>var</parameter></term>
25
+
<term><parameter>value</parameter></term>
26
26
<listitem>
27
27
<para>
28
28
The variable being evaluated.
...
...
@@ -35,7 +35,7 @@
35
35
<refsect1 role="returnvalues">
36
36
&reftitle.returnvalues;
37
37
<para>
38
-
Returns &true; if <parameter>var</parameter> is a <type>boolean</type>,
38
+
Returns &true; if <parameter>value</parameter> is a <type>bool</type>,
39
39
&false; otherwise.
40
40
</para>
41
41
</refsect1>
...
...
@@ -50,14 +50,14 @@
50
50
$a = false;
51
51
$b = 0;
52
52

53
-
// Since $a is a boolean, this is true
54
-
if (is_bool($a)) {
53
+
// Since $a is a boolean, it will return true
54
+
if (is_bool($a) === true) {
55
55
echo "Yes, this is a boolean";
56
56
}
57
57

58
-
// Since $b is not a boolean, this is not true
59
-
if (is_bool($b)) {
60
-
echo "Yes, this is a boolean";
58
+
// Since $b is not a boolean, it will return false
59
+
if (is_bool($b) === false) {
60
+
echo "No, this is not a boolean";
61
61
}
62
62
?>
63
63
]]>
...
...
@@ -78,7 +78,6 @@ if (is_bool($b)) {
78
78
</para>
79
79
</refsect1>
80
80
</refentry>
81
-

82
81
<!-- Keep this comment at the end of the file
83
82
Local variables:
84
83
mode: sgml
85
84