mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
document the change in the first parameter to 'mixed'
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@171390 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
f647fe15cd
commit
d5822b0590
1 changed files with 26 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.4 -->
|
||||
<refentry id="function.is-subclass-of">
|
||||
<refnamediv>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_subclass_of</methodname>
|
||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -20,6 +20,12 @@
|
|||
<parameter>object</parameter>, belongs to a class which is a
|
||||
subclass of <parameter>class_name</parameter>, &false; otherwise.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Since PHP 5.0.3 you may also specify the <parameter>object</parameter>
|
||||
parameter as a string (the name of the class).
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>is_subclass_of</function> example</title>
|
||||
|
@ -47,18 +53,33 @@ if (is_subclass_of($WFC, 'WidgetFactory')) {
|
|||
} else {
|
||||
echo "no, \$WFC is not a subclass of WidgetFactory\n";
|
||||
}
|
||||
// Outputs "yes, $WFC is a subclass of WidgetFactory\n";
|
||||
|
||||
|
||||
if (is_subclass_of($WF, 'WidgetFactory')) {
|
||||
echo "yes, \$WF is a subclass of WidgetFactory\n";
|
||||
} else {
|
||||
echo "no, \$WF is not a subclass of WidgetFactory\n";
|
||||
}
|
||||
// Outputs "no, $WF is not a subclass of WidgetFactory\n"
|
||||
|
||||
|
||||
// usable only since PHP 5.0.3
|
||||
if (is_subclass_of('WidgetFactory_Child', 'WidgetFactory')) {
|
||||
echo "yes, WidgetFactory_Child is a subclass of WidgetFactory\n";
|
||||
} else {
|
||||
echo "no, WidgetFactory_Child is not a subclass of WidgetFactory\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
yes, $WFC is a subclass of WidgetFactory
|
||||
no, $WF is not a subclass of WidgetFactory
|
||||
yes, WidgetFactory_Child is a subclass of WidgetFactory
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>get_class</function>,
|
||||
|
|
Loading…
Reference in a new issue