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
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: 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

Pull Requests

History

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