php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #41071 TYPO IN simplexml-load-file DOCS
Submitted: 2007-04-13 00:18 UTC Modified: 2007-05-28 12:04 UTC
From: php at primezero dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: IRRELEVANT
Private report: No CVE-ID: None
 [2007-04-13 00:18 UTC] 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() 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-28 12:04 UTC] bjori@php.net
Nice catch, fixed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 13:01:31 2025 UTC