Bug #18319: is_a fails to match DOM classes
| From: | brblueser at uol dot com dot br | Date: | Fri, 12 Jul 2002 16:43:18 +0000 |
| Subject: | Bug #18319: is_a fails to match DOM classes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13995@lists.php.net to get a copy of this message | ||
From: brblueser@uol.com.br
Operating system: Linux 2.4.19-pre1
PHP version: 4.2.1
PHP Bug Type: Class/Object related
Bug description: is_a fails to match DOM classes
I searched the bug database for "is_a" but found no entries, so I thought I
should post this here...
The code below always prints "failed!!!":
<?php
$dom = domxml_new_doc("<?xml version=\"1.0\"?" .
"><me><name>Joe
Cool</name><age>24</age><gender>male</gender></me>");
$elem = $dom->create_element("aaa");
// any of the if's below fails
if ( is_a( $elem, "DomElement" ) )
// if ( is_a( $elem, get_class( $elem ) ) )
{
echo "OK\n";
}
else
{
echo "failed!!!\n";
}
?>
My config line was:
./configure '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' \
'--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' \
'--includedir=/usr/include' '--libdir=/usr/lib' \
'--libexecdir=/usr/libexec' '--localstatedir=/var' \
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' \
'--infodir=/usr/share/info' '--prefix=/usr' \
'--with-config-file-path=/etc' '--enable-force-cgi-redirect' \
'--disable-debug' '--enable-pic' '--disable-rpath' \
'--enable-inline-optimization' '--with-bz2' '--with-db3' \
'--with-exec-dir=/usr/bin' '--with-gd' '--with-gdbm=/usr' \
'--with-gettext' '--with-gmp' '--with-jpeg-dir=/usr'
'--with-mm' \
'--with-openssl' '--with-png' '--with-pspell'
'--with-regex=system' \
'--with-xml' '--with-dom=/usr' '--with-expat-dir=/usr'
'--with-zlib' \
'--with-layout=GNU' '--enable-bcmath' '--enable-debugger'
'--enable-ftp'
\
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' \
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' \
'--enable-trans-sid' '--enable-yp' '--enable-wddx'
'--without-oci8' \
'--with-kerberos=/usr/kerberos' '--with-sybase=/usr/local/freetds' \
'--with-apxs=/usr/sbin/apxs' '--enable-cli'
The output of 'php -m' is:
costa:~/public_html php -m
Running PHP 4.2.1
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies
[PHP Modules]
yp
xml
wddx
sysvshm
sysvsem
sybase
standard
sockets
session
pspell
posix
pcre
openssl
mysql
gmp
gettext
gd
ftp
domxml
dba
ctype
bz2
bcmath
zlib
session mm
[Zend Modules]
-----
on the above example, replacing the test for
if ( get_class( $elem ) == "DomElement" )
works.
Let me know if you need more info.
Best,
Andre
--
Edit bug report at http://bugs.php.net/?id=18319&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18319&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18319&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18319&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18319&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18319&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18319&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18319&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18319&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18319&r=globals