|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-12 15:21 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 07:00:01 2025 UTC |
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