php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73982 DOMElement->tagName and DOMAttr->value don't work anymore
Submitted: 2017-01-23 22:31 UTC Modified: 2017-01-23 22:52 UTC
From: rgpublic at gmx dot net Assigned:
Status: Closed Package: DOM XML related
PHP Version: 7.1.1 OS: Ubuntu 16.04.1 LTS
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rgpublic at gmx dot net
New email:
PHP Version: OS:

 

 [2017-01-23 22:31 UTC] rgpublic at gmx dot net
Description:
------------
I'm using PHP 7.1.1 from Ondrej Sury PPA (https://launchpad.net/~ondrej/+ppa-packages). I've already reported this bug over there and was told that it's an upstream bug (https://github.com/oerdnj/deb.sury.org/issues/534).

The test script should output div<br />test<br />.

Doesnt work on 7.1.1. Can this bug be for real? A bit puzzled that this hasnt been caught during some automated tests cause it's so obvious...



Test script:
---------------
<?php

$html=new DOMDocument();
$html->loadHTML('<div class="test">HALLO</div>');

$tags=$html->getElementsByTagName("div");

echo $tags[0]->tagName."<br />";

foreach ($tags[0]->attributes as $attr) {
  echo $attr->value."<br />";
}

Expected result:
----------------
div<br />test<br />

Actual result:
--------------
(nothing!)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-23 22:40 UTC] nikic@php.net
https://3v4l.org/jlp6E => Output the same for all versions >= 5.6.3.
 [2017-01-23 22:52 UTC] rgpublic at gmx dot net
-Status: Open +Status: Closed
 [2017-01-23 22:52 UTC] rgpublic at gmx dot net
Really, really(!) crazy. It definitely didnt work this afternoon. I'm so sure because I was fighting all day with this and I needed to find a workaround for multiple websites to get them running again. They were even spitting out notices in the log like "Property tagName does not exist" etc. Hmm. Thanks a lot anyway. Didnt know about 3v4l.org. Bookmarked it and will test there before filing bugs in the future. Promised :-)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 12:01:27 2025 UTC