php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79883 Documentation on foreach neglects to mention the alternate syntax.
Submitted: 2020-07-22 07:19 UTC Modified: 2020-08-18 13:37 UTC
From: mark at manngo dot net Assigned:
Status: Open Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mark at manngo dot net
New email:
PHP Version: OS:

 

 [2020-07-22 07:19 UTC] mark at manngo dot net
Description:
------------
---
From manual page: https://php.net/control-structures.foreach
---

Apart from a helpful comment, there is no mention of the alternate syntax for foreach.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-22 07:28 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-07-22 07:28 UTC] cmb@php.net
There is a dedicated page for the alternative syntax of control
structures[1], and in my opinion, this is better than to mention
that again on all the other pages. 

[1] <https://www.php.net/manual/en/control-structures.alternative-syntax.php>
 [2020-07-22 08:17 UTC] mark at manngo dot net
Possibly, but since the pages on while, for, if and switch all mention the alternative syntax, this looks like an omission.
 [2020-07-22 08:30 UTC] cmb@php.net
-Status: Not a bug +Status: Open
 [2020-07-22 08:30 UTC] cmb@php.net
Indeed, the alternative syntax is mentionend on the while, for,
and switch pages (apparently not on the if page), so might make
sense to add this info on the foreach page as well.  I don't have
a strong feeling about either way.
 [2020-07-22 08:30 UTC] cmb@php.net
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2020-07-22 08:41 UTC] mark at manngo dot net
I’d be more than happy to write something and submit that. Ditto for the if page.
 [2020-08-18 13:37 UTC] cmb@php.net
> I’d be more than happy to write something and submit that. Ditto
> for the if page.

You can submit PRs to <https://github.com/php/doc-en>.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Oct 24 21:01:24 2020 UTC