reference/classobj/functions/is-a.xml
fd65805e83f7dc3b12ab5844cafc4489dc367a27
...
...
@@ -3,19 +3,20 @@
3
3
<refentry xml:id="function.is-a" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>is_a</refname>
6
-
<refpurpose>Checks if the object is of this class or has this class as one of its parents</refpurpose>
6
+
<refpurpose>Checks whether the object is of a given type or subtype</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>is_a</methodname>
12
-
<methodparam><type>mixed</type><parameter>object</parameter></methodparam>
13
-
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
12
+
<methodparam><type>mixed</type><parameter>object_or_class</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>class</parameter></methodparam>
14
14
<methodparam choice="opt"><type>bool</type><parameter>allow_string</parameter><initializer>&false;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
-
Checks if the given <parameter>object</parameter> is of this class or has
18
-
this class as one of its parents.
17
+
Determines if the given <parameter>object_or_class</parameter> is the
18
+
<parameter>class</parameter> object type,
19
+
or has <parameter>class</parameter> as one of its supertypes.
19
20
</para>
20
21
</refsect1>
21
22
<refsect1 role="parameters">
...
...
@@ -23,7 +24,7 @@
23
24
<para>
24
25
<variablelist>
25
26
<varlistentry>
26
-
<term><parameter>object</parameter></term>
27
+
<term><parameter>object_or_class</parameter></term>
27
28
<listitem>
28
29
<para>
29
30
A class name or an object instance.
...
...
@@ -31,10 +32,10 @@
31
32
</listitem>
32
33
</varlistentry>
33
34
<varlistentry>
34
-
<term><parameter>class_name</parameter></term>
35
+
<term><parameter>class</parameter></term>
35
36
<listitem>
36
37
<para>
37
-
The class name
38
+
The class or interface name
38
39
</para>
39
40
</listitem>
40
41
</varlistentry>
...
...
@@ -42,7 +43,7 @@
42
43
<term><parameter>allow_string</parameter></term>
43
44
<listitem>
44
45
<para>
45
-
If this parameter set to &false;, string class name as <parameter>object</parameter>
46
+
If this parameter set to &false;, string class name as <parameter>object_or_class</parameter>
46
47
is not allowed. This also prevents from calling autoloader if the class doesn't exist.
47
48
</para>
48
49
</listitem>
...
...
@@ -53,8 +54,9 @@
53
54
<refsect1 role="returnvalues">
54
55
&reftitle.returnvalues;
55
56
<para>
56
-
Returns &true; if the object is of this class or has this class as one of
57
-
its parents, &false; otherwise.
57
+
Returns &true; if <parameter>object_or_class</parameter> is the
58
+
<parameter>class</parameter> object type,
59
+
or has <parameter>class</parameter> as one of its supertypes, &false; otherwise.
58
60
</para>
59
61
</refsect1>
60
62
<refsect1 role="examples">
...
...
@@ -82,7 +84,7 @@ if (is_a($WF, 'WidgetFactory')) {
82
84
</programlisting>
83
85
</example>
84
86
<example>
85
-
<title>Using the <emphasis>instanceof</emphasis> operator in PHP 5</title>
87
+
<title>Using the <emphasis>instanceof</emphasis> operator</title>
86
88
<programlisting role="php">
87
89
<![CDATA[
88
90
<?php
...
...
@@ -106,7 +108,6 @@ if ($WF instanceof WidgetFactory) {
106
108
</para>
107
109
</refsect1>
108
110
</refentry>
109
-

110
111
<!-- Keep this comment at the end of the file
111
112
Local variables:
112
113
mode: sgml
113
114