reference/classobj/functions/is-a.xml
c558c3af38874a913c7515bbd49aaf2e689cbdd0
c558c3af38874a913c7515bbd49aaf2e689cbdd0
...
...
@@ -14,8 +14,9 @@
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_or_class</parameter> is of this object type or has
18
-
this object type as one of its supertypes.
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">
...
...
@@ -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 object type or has this object type as one of
57
-
its supertypes, &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">
...
...
@@ -86,6 +88,15 @@ if (is_a($WF, 'WidgetFactory')) {
86
88
<programlisting role="php">
87
89
<![CDATA[
88
90
<?php
91
+
// define a class
92
+
class WidgetFactory
93
+
{
94
+
var $oink = 'moo';
95
+
}
96
+
97
+
// create a new object
98
+
$WF = new WidgetFactory();
99
+
89
100
if ($WF instanceof WidgetFactory) {
90
101
echo 'Yes, $WF is a WidgetFactory';
91
102
}
92
103