php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32209 Missing ? in processing instruction
Submitted: 2005-03-06 22:35 UTC Modified: 2005-03-07 08:10 UTC
From: md2perpe at gmail dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5CVS-2005-03-06 OS: *
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: md2perpe at gmail dot com
New email:
PHP Version: OS:

 

 [2005-03-06 22:35 UTC] md2perpe at gmail dot com
Description:
------------
According to http://www.w3.org/TR/REC-xml/#sec-pi a processing instruction should begin with <?something and end with ?>. But DOMDocument::createProcessingInstruction doesn't output the questionmark at the end.


Reproduce code:
---------------
<?php
$doc = new DOMDocument();
$pi = $doc->createProcessingInstruction('name', 'content');
$doc->appendChild($pi);
echo $doc->saveHTML();
?>


Expected result:
----------------
<?name content?>


Actual result:
--------------
<?name content>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 02:01 UTC] Jared dot Williams1 at ntlworld dot com
saveHTML is correctly using SGML processing instruction close. HTML isnt XML.

Use saveXML for XML/XHTML.
 [2005-03-07 08:10 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Mar 13 19:01:31 2025 UTC