|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24559 XML_Xpath class has several showstopper bugs
Submitted: 2003-07-09 05:55 UTC Modified: 2003-08-12 18:38 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: Assigned: dallen (profile)
Status: Closed Package: PEAR related
PHP Version: Irrelevant OS: Win2k
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2003-07-09 05:55 UTC]
There are several bugs related to comparing a calls to get_class with a mixed case string (get_class always returns lower case strings):
get_class($in_xml) == 'DomDocument'

Furthermore the examples do not work.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-31 04:12 UTC]
Can anyone take a look at this fix?

Index: XPath.php
RCS file: /repository/pear/XML_XPath/XPath.php,v
retrieving revision 1.16
diff -u -u -r1.16 XPath.php
--- XPath.php   16 Jan 2003 19:10:51 -0000      1.16
+++ XPath.php   31 Jul 2003 09:11:40 -0000
@@ -126,7 +126,7 @@
         // we need to capture errors, since there is not interface for this
         // in this case, we already have an xmldom object
-        if ($in_type == 'object' && get_class($in_xml) == 'DomDocument') {
+        if ($in_type == 'object' && strtolower(get_class($in_xml)) == 'domdocument') {
             $this->xml = $in_xml;
         // we can read the file, so use xmldocfile to make a xmldom object
@@ -145,7 +145,7 @@
         $loadError = ob_get_contents();
         // make sure a domxml object was created, and if so initialized the state
-        if (get_class($this->xml) == 'DomDocument') {
+        if (strtolower(get_class($this->xml)) == 'domdocument') {
             $this->loaded = true;
             $this->ctx = $this->xml->xpath_new_context();
             $this->pointer = $this->xml->root();

 [2003-08-12 18:38 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue May 30 18:03:41 2023 UTC