php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38119 iterator object not available
Submitted: 2006-07-17 01:06 UTC Modified: 2006-07-17 15:45 UTC
From: mdangus at psychtest dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Win2K
Private report: No CVE-ID: None
 [2006-07-17 01:06 UTC] mdangus at psychtest dot com
Description:
------------
The following code does nothing after $chapter_array->getiterator() (though the manual suggests it should work). 



Reproduce code:
---------------
#=============
$chapter_array->rewind();
$iterator=$chapter_array->getIterator();
echo $iterator->current();
echo $iterator->key();
#=============


Expected result:
----------------
The value of iterator for the array $chapter_array should be echoed, the current key value of the array iterator for $chapter_array should be echoed.

Actual result:
--------------
Docs in error? This gets parsed but nothing happens.

I have searched this, and apparently the above "object oriented" coding format for PHP originally derived from something called phplib? From what I can find in the docs, it is suggested that this object oriented functionality was added into php as a standard part of the distro as of php4. However, I can find no information on it at all. The manual says this code should work, but it has no suggestions at all as to what to do to find any necessary includes or why this code does not work in the standard distro for windows. 

Are the docs out of date? Am I missing something? Is there a library hidden away somewhere that one has to find and download.

I have searched for about 4 days for an answer -- including 2 messages to the user mailing list which went totally unanswered. Bit of a newb with php - trying to learn from the docs... may be the docs could be improved to let people know whether the object-oriented style is supported or not.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-17 06:48 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-07-17 15:36 UTC] mdangus at psychtest dot com
bogus bug report - sorry - my syntax error -- not documentation error. 

Thanks.
 [2006-07-17 15:45 UTC] nlopess@php.net
close it then.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Feb 21 08:00:02 2026 UTC