php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #31697 foreach doc doesn't mention object-iteration
Submitted: 2005-01-25 23:50 UTC Modified: 2005-04-27 15:47 UTC
From: tularis@php.net Assigned: tularis (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
 [2005-01-25 23:50 UTC] tularis@php.net
Description:
------------
The foreach documentation page doesn't mention the fact that foreach can also be used to iterate trough an object's properties.

Reproduce code:
---------------
- 

Expected result:
----------------
foreach contains a notice about objects

Actual result:
--------------
none

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-25 23:51 UTC] tularis@php.net
assigning to myself (so I don't forget)
 [2005-01-26 01:09 UTC] jed@php.net
It's mentioned in the PHP 5 docs, and includes implementing Iterator from the SPL.

http://www.php.net/manual/en/language.oop5.iterations.php

I think the general rule is place things where it doesn't seem like they'd be, since PHP 5 is so radically different it deserves its own manual section, and the rest of the manual isn't clear on what PHP 4 and PHP 5 is anymore.
 [2005-01-26 02:14 UTC] philip@php.net
Jed, there is no such general rule. If you find places in the manual that "aren't clear" on this then please fix it or submit a bug report. The only real difference between PHP 4 and PHP 5 is the OOP model which is why a separate OOP section exists.
 [2005-01-26 09:47 UTC] tularis@php.net
I agree with philip on this, and believe it should at least be mentioned. When a person new to PHP reads the manual, they won't automatically go to the PHP5-section to read up on the changes since PHP4, they'll instead want to read them in the manual itself, in the places that it actually applies to.
 [2005-04-27 15:47 UTC] vrana@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.

"As of PHP 5, it is possible to <link linkend="language.oop5.iterations">iterate objects</link> too."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 17:01:28 2024 UTC