note 34782 added to function.is-a
| From: | luis at rack1 dot php dot net | Date: | Wed, 06 Aug 2003 16:20:27 +0000 |
| Subject: | note 34782 added to function.is-a | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53520@lists.php.net to get a copy of this message | ||
What happend with is_a() function ?
With:
<?php
$dom = domxml_open_mem( "<doc>Hello</doc>" ); // return a DomDocument
Object
print "\n \$dom is a " . get_class( $dom );
$theName = "DomDocument";
if ( is_a( $dom, $theName) ) {
print "\n \$dom is a $theName";
} else {
print "\n \$dom is not a $theName";
}
$theName = get_class( $dom );
if ( is_a( $dom, $theName) ) {
print "\n \$dom is a $theName";
} else {
print "\n \$dom is not a $theName";
}
?>
the output is:
$dom is a DomDocument
$dom is not a DomDocument
$dom is not a DomDocument
any help ?
I´m using php version 4.2.3
----
Manual Page -- http://www.php.net/manual/en/function.is-a.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34782
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34782&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34782&report=yes