Doc #65442 [Ver->Csd]: Example number 1 code needs fixing.

From: Date: Wed, 18 Dec 2013 21:02:59 +0000
Subject: Doc #65442 [Ver->Csd]: Example number 1 code needs fixing.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10719@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65442&edit=1 ID: 65442 Updated by: philstu@php.net Reported by: contactme at antonydandrea dot com Summary: Example number 1 code needs fixing. -Status: Verified +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Ubuntu PHP Version: Irrelevant Assigned To: philstu Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2013-12-16 21:38:14] philstu@php.net Fixed locally, just waiting on SVN server issues to be resolved before I can commit. ------------------------------------------------------------------------ [2013-08-13 14:01:12] contactme at antonydandrea dot com Description: ------------ --- From manual page: http://www.php.net/example.xml-structure --- Example one that shows an example usage throws an undefined index. This is because when it first calls startElement, $depth[$parser] does not get initialised. To fix this, I changed the startElement function to function startElement($parser, $name, $attrs) { global $depth; if (isset($depth[$parser])) { for ($i = 0; $i < $depth[$parser]; $i++) { echo " "; } } else { $depth[$parser] = 0; } echo "$name\n"; $depth[$parser]++; } Would be good to add this improvement to the documentation. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65442&edit=1

« previous php.doc.bugs (#10719) next »