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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC