#32743 [Opn]: Error with type of 2nd parameter when creating DOMDocument()

From: Date: Mon, 18 Apr 2005 14:44:08 +0000
Subject: #32743 [Opn]: Error with type of 2nd parameter when creating DOMDocument()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77795@lists.php.net to get a copy of this message
ID: 32743 User updated by: jj at intelequest dot com Reported By: jj at intelequest dot com Status: Open Bug Type: DOM XML related Operating System: Windows XP PHP Version: 5.0.4 New Comment: The reproduce code is as follows: $dom = new DOMDocument('1.0', 'iso-8859-1'); echo $dom->saveXML(); Previous Comments: ------------------------------------------------------------------------ [2005-04-18 16:27:58] jj at intelequest dot com Description: ------------ When executing the demo code found at http://www.php.net/manual/en/function.dom-domdocument-construct.php I obtain the error message. "Warning: domdocument() expects parameter 2 to be long" My understanding (from the online docs) is that the 2nd parameter is to be of type string. Also, according to the documentation, this is the php 5 replacment to DOM_XML i.e. this is DOM XML. Note that there is no sub-category for just DOM so the next logical place to put errors such as these would be either DOM XML or Documentation bug. Reproduce code: --------------- <?PHP $dom = new DOMDocument('1.0', 'iso-8859-1'); echo $dom->saveXML(); ?> Expected result: ---------------- <?xml version="1.0" encoding="iso-8859-1"?> Actual result: -------------- Warning: domdocument() expects parameter 2 to be long, string given in C:\temp\test_xml.php on line 2 Fatal error: Call to undefined method domdocument::saveXML() in C:\temp\test_xml.php on line 3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32743&edit=1

« previous php.bugs (#77795) next »