php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53186 Error in the example
Submitted: 2010-10-27 18:22 UTC Modified: 2010-11-06 02:13 UTC
From: bruce at z2a dot org Assigned: frozenfire (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant 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: bruce at z2a dot org
New email:
PHP Version: OS:

 

 [2010-10-27 18:22 UTC] bruce at z2a dot org
Description:
------------
This example doesn't work.  The output is supposed to be "movie" but there is no movie in the inputs.


Patches

simplexml-examples-addincludenote (last revision 2010-11-05 21:02 UTC by frozenfire at thefrozenfire dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-27 18:26 UTC] salathe@php.net
Which page is this error on?
 [2010-10-27 19:48 UTC] bruce at z2a dot org
Oops... I thought the "Report A Bug" would include a back pointer to the page.
It is on http://us2.php.net/manual/en/simplexmlelement.getName.php.
I think the example is building on a previous page but it would be better if you could understand the getName example on the page where it is described.
 [2010-10-27 23:51 UTC] salathe@php.net
Many of the SimpleXML examples include an "example.php" file that can be found here: http://php.net/manual/en/simplexml.examples-basic.php

We do try to make examples as standalone as possible so I can certainly understand the confusion here. Perhaps it is worth linking back to the page above from those examples which make use of that example.php file.
 [2010-10-28 11:35 UTC] rquadling@php.net
Relating to Bruce's comment 2010-10-27 17:48 UTC, http://bugs.php.net/bug.php?
id=53189
 [2010-11-05 22:05 UTC] frozenfire at thefrozenfire dot com
I have added a patch which adds a note to each example section which makes use of the example.php include, noting where that code can be found. This should clear up any confusion to that effect.

Tangentially, the SimpleXMLElement::getName() example does indeed function as expected.
 [2010-11-06 00:05 UTC] frozenfire@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: frozenfire
 [2010-11-06 00:56 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=305120
Log: Added a note to all SimpleXMLElement method examples which make use of the example.php include, indicating where that include is located. As per bug #53186.
 [2010-11-06 02:13 UTC] frozenfire@php.net
-Status: Assigned +Status: Closed
 [2010-11-06 02:13 UTC] frozenfire@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 12:00:01 2026 UTC