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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Thu Aug 22 15:01:28 2019 UTC