php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73938 PHP7 foreach internal array pointer
Submitted: 2017-01-15 02:16 UTC Modified: 2017-01-15 19:03 UTC
From: tristanlbailey at sgsoftware dot com dot au Assigned:
Status: Verified Package: Arrays related
PHP Version: 7.0.14 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: tristanlbailey at sgsoftware dot com dot au
New email:
PHP Version: OS:

 

 [2017-01-15 02:16 UTC] tristanlbailey at sgsoftware dot com dot au
Description:
------------
---
From manual page: http://www.php.net/function.current
---
PHP 7 no longer modifies the internal array pointer in foreach control structures. This should be mentioned somewhere on this page.

http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.foreach.array-pointer


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-15 02:20 UTC] tristanlbailey at sgsoftware dot com dot au
Specifically, the current() function will always return int(0) when used in foreach control structures.
 [2017-01-15 19:03 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Feature/Change Request +Type: Documentation Problem -Package: Documentation problem +Package: Arrays related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 13:01:25 2019 UTC