Edit report at http://bugs.php.net/bug.php?id=51553&edit=1
ID: 51553 Updated by: degeb...@php.net Reported by: sarahnorthway at gmail dot com Summary: bug in simplexmlelement count example -Status: Open +Status: Bogus Type: Documentation Problem Package: SimpleXML related PHP Version: Irrelevant New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. That's not necessary. Did you actually run the code? :) When you iterate over a SimpleXML element, it's its children you'll get. What else should it be? dan...@daniel-laptop:~$ php -v; php test.php PHP 5.3.3-dev (cli) (built: Mar 29 2010 15:35:44) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans Person 1 has got 3 children. Person 2 has got 5 children. Previous Comments: ------------------------------------------------------------------------ [2010-04-14 00:37:51] sarahnorthway at gmail dot com Description: ------------ In the examples for simplexmlelement->count at http://www.php.net/manual/en/simplexmlelement.count.php, the line: foreach ($elem as $person) { should be: foreach ($elem->children() as $person) { ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51553&edit=1