php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36987 print_r doesn't show DOM Objects properties
Submitted: 2006-04-05 14:23 UTC Modified: 2006-04-05 14:34 UTC
From: takacsz at hik dot hu Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.1.2 OS: windows xp
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: takacsz at hik dot hu
New email:
PHP Version: OS:

 

 [2006-04-05 14:23 UTC] takacsz at hik dot hu
Description:
------------
I find a possibly bug, when I wanted to print the structure of a DOMDocument or a DOMDocumentType object.
print_r() outputs the object type correctly, but the properties are missing.

$doc = $imp->createDocument();
$doc->loadXML($xmlString);
print_r($doc->doctype);

the code outputs:

DOMDocumentType Object
(
)

But the subobjects of $doc->doctype exist.


Reproduce code:
---------------
<?php

$doc = new DOMDocument();
$doc->loadXML('<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE book PUBLIC "-//EDUCATIO Kht.//DocBook V4.3-alapu DTD V1.1//HU" "http://www.hik.hu/tankonyvpalyazat/dtd2/tankonyv.dtd"><book></book>');
print_r($doc->doctype);

?>

Expected result:
----------------
something like that:

DOMDocumentType Object
(
  publicId
  systemId
  name
  entities
  notations
  internalSubset
)


Actual result:
--------------
DOMDocumentType Object
(
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-05 14:34 UTC] tony2001@php.net
Duplicate of bug #30786.	
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 16:01:34 2024 UTC