#41071 [Opn->Csd]: TYPO IN simplexml-load-file DOCS

From: Date: Mon, 28 May 2007 12:04:08 +0000
Subject: #41071 [Opn->Csd]: TYPO IN simplexml-load-file DOCS
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969376475@lists.php.net to get a copy of this message
ID: 41071 Updated by: bjori@php.net Reported By: php at primezero dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: IRRELEVANT PHP Version: Irrelevant New Comment: Nice catch, fixed. Previous Comments: ------------------------------------------------------------------------ [2007-04-13 00:18:32] php at primezero dot com Description: ------------ On the following web page: http://us.php.net/manual/en/function.simplexml-load-file.php Correction required for "Example 2158. Interpret an XML document." Instead of var_dump() it should print_r() since the datatypes are not displayed in the example shown. Reproduce code: --------------- <?php // The file test.xml contains an XML document with a root element // and at least an element /[root]/title. if (file_exists('test.xml')) { $xml = simplexml_load_file('test.xml'); var_dump($xml); ### <---- BZZZZZZ HERE'S THE MINOR BOO BOO } else { exit('Failed to open test.xml.'); } ?> Expected result: ---------------- object(SimpleXMLElement)#1 (1) <-- with var_dump() Actual result: -------------- SimpleXMLElement Object <--- with print_r() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41071&edit=1

« previous php.doc (#969376475) next »