reference/classobj/functions/is-subclass-of.xml
c44475e1fafcbee203ed4935a6d5d7a01379fcdc
...
...
@@ -9,13 +9,13 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>is_subclass_of</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>&true;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
-
Checks if the given <parameter>object</parameter> has the class
18
-
<parameter>class_name</parameter> as one of its parents or implements it.
17
+
Checks if the given <parameter>object_or_class</parameter> has the class
18
+
<parameter>class</parameter> as one of its parents or implements it.
19
19
</para>
20
20
</refsect1>
21
21
<refsect1 role="parameters">
...
...
@@ -23,7 +23,7 @@
23
23
<para>
24
24
<variablelist>
25
25
<varlistentry>
26
-
<term><parameter>object</parameter></term>
26
+
<term><parameter>object_or_class</parameter></term>
27
27
<listitem>
28
28
<para>
29
29
A class name or an object instance. No error is generated if the class does not exist.
...
...
@@ -31,7 +31,7 @@
31
31
</listitem>
32
32
</varlistentry>
33
33
<varlistentry>
34
-
<term><parameter>class_name</parameter></term>
34
+
<term><parameter>class</parameter></term>
35
35
<listitem>
36
36
<para>
37
37
The class name
...
...
@@ -42,7 +42,7 @@
42
42
<term><parameter>allow_string</parameter></term>
43
43
<listitem>
44
44
<para>
45
-
If this parameter set to false, string class name as <parameter>object</parameter>
45
+
If this parameter set to false, string class name as <parameter>object_or_class</parameter>
46
46
is not allowed. This also prevents from calling autoloader if the class doesn't exist.
47
47
</para>
48
48
</listitem>
...
...
@@ -53,46 +53,9 @@
53
53
<refsect1 role="returnvalues">
54
54
&reftitle.returnvalues;
55
55
<para>
56
-
This function returns &true; if the object <parameter>object</parameter>,
56
+
This function returns &true; if the object <parameter>object_or_class</parameter>,
57
57
belongs to a class which is a subclass of
58
-
<parameter>class_name</parameter>, &false; otherwise.
59
-
</para>
60
-
</refsect1>
61
-
<refsect1 role="changelog">
62
-
&reftitle.changelog;
63
-
<para>
64
-
<informaltable>
65
-
<tgroup cols="2">
66
-
<thead>
67
-
<row>
68
-
<entry>&Version;</entry>
69
-
<entry>&Description;</entry>
70
-
</row>
71
-
</thead>
72
-
<tbody>
73
-
<row>
74
-
<entry>5.3.9</entry>
75
-
<entry>
76
-
Added <parameter>allow_string</parameter> parameter
77
-
</entry>
78
-
</row>
79
-
<row>
80
-
<entry>5.3.7</entry>
81
-
<entry>
82
-
Added support for <parameter>class_name</parameter> to work with
83
-
interfaces
84
-
</entry>
85
-
</row>
86
-
<row>
87
-
<entry>5.0.3</entry>
88
-
<entry>
89
-
You may also specify the <parameter>object</parameter> parameter as a
90
-
string (the name of the class)
91
-
</entry>
92
-
</row>
93
-
</tbody>
94
-
</tgroup>
95
-
</informaltable>
58
+
<parameter>class</parameter>, &false; otherwise.
96
59
</para>
97
60
</refsect1>
98
61
<refsect1 role="examples">
...
...
@@ -133,7 +96,6 @@ if (is_subclass_of($WF, 'WidgetFactory')) {
133
96
}
134
97

135
98

136
-
// usable only since PHP 5.0.3
137
99
if (is_subclass_of('WidgetFactory_Child', 'WidgetFactory')) {
138
100
echo "yes, WidgetFactory_Child is a subclass of WidgetFactory\n";
139
101
} else {
...
...
@@ -222,7 +184,6 @@ Yes, MyClass is a subclass of MyInterface
222
184
</para>
223
185
</refsect1>
224
186
</refentry>
225
-

226
187
<!-- Keep this comment at the end of the file
227
188
Local variables:
228
189
mode: sgml
229
190