Bug #18319 Updated: is_a fails to match DOM classes
| From: | derick@php.net | Date: | Fri, 12 Jul 2002 19:21:53 +0000 |
| Subject: | Bug #18319 Updated: is_a fails to match DOM classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14013@lists.php.net to get a copy of this message | ||
ID: 18319
Updated by: derick@php.net
Reported By: brblueser@uol.com.br
-Status: Open
+Status: Closed
Bug Type: Class/Object related
Operating System: Linux 2.4.19-pre1
PHP Version: 4.2.1
New Comment:
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-07-12 12:43:17] brblueser@uol.com.br
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 this bug report at http://bugs.php.net/?id=18319&edit=1