Doc #55264 [Opn->Fbk]: Example does nothing
| From: | salathe@php.net | Date: | Fri, 22 Jul 2011 08:52:23 +0000 |
| Subject: | Doc #55264 [Opn->Fbk]: Example does nothing | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6913@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55264&edit=1
ID: 55264
Updated by: salathe@php.net
Reported by: jeremybotto at gmail dot com
Summary: Example does nothing
-Status: Open
+Status: Feedback
Type: Documentation Problem
Package: Documentation problem
Operating System: php
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Can you clarify a few things, please?
When you say "there is no visible change", where did you expect anything to be
changed (the example should print the manipulated XML to the screen, terminal,
wherever)? What do you mean by "verifies that a translation of the input matches
the input", there is no translation of any kind going on.
For what it's worth, here's an include-less version of that example showing the
expected output: http://codepad.org/gwx8oJpw
Finally, with regards to the SimpleXML examples requiring the example.php file,
this was done to avoid clogging up the examples with 28 lines of code again and
again. Requiring external files is not something we usually ask for examples,
which should be able to run "standalone" ideally.
Previous Comments:
------------------------------------------------------------------------
[2011-07-22 04:39:31] jeremybotto at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/simplexmlelement.addattribute%23Examples
---
The sample code depends upon the inclusion of example code, example.php, from an
earlier page. Without example.php, the sample code does not work. Running the
sample code outputs the the input. There is no visible change on inspection of
the files, directories, and source code. I tried stripping parts of example.php
out, to see if the code sample actually added any attributes, and the sample code
just throws errors when lines are removed. Basically, the code does nothing to
'manipulate' XML. It simply verifies that a translation of the input matches the
input.
Can we get an example that doesn't depend upon external files and that actually
changes something, please?
Expected result:
----------------
Add an attribute to an XML file via PHP.
Actual result:
--------------
Does nothing.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55264&edit=1