added example

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@152218 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sean Coates 2004-02-24 05:54:36 +00:00
parent 25204cd363
commit 1d404db692

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.33 -->
<refentry id="function.is-a">
<refnamediv>
@ -20,6 +20,30 @@
This function returns &true; if the object is of this class or
has this class as one of its parents, &false; otherwise.
</para>
<para>
<example>
<title>An <function>exec</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// define a class
class WidgetFactory
{
var $oink = 'moo';
}
// create a new object
$WF = new WidgetFactory();
if (is_a($WF, 'WidgetFactory'))
{
echo 'yes, $WF is still a WidgetFactory';
}
?>
]]>
</programlisting>
</example>
</para>
<simpara>
See also <function>get_class</function>,
<function>get_parent_class</function>, and