php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43258 Next() function behavior changed
Submitted: 2007-11-12 08:19 UTC Modified: 2007-11-12 09:38 UTC
From: frankw at well dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2CVS-2007-11-12 (snap) OS: W2K
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: frankw at well dot com
New email:
PHP Version: OS:

 

 [2007-11-12 08:19 UTC] frankw at well dot com
Description:
------------
The behavior of the next() function has changed between versions 4 and 5.

Reproduce code:
---------------
<?php
$a = array( "a", "b", "c");
foreach ($a as $aa) {
    print($aa);
    if (next($a))
        print(" + ");
}
?>


Expected result:
----------------
a + b + c

Actual result:
--------------
a + bc

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-12 08:21 UTC] frankw at well dot com
Old PHP version: 4.3.10, new version 5.2.5. Both on Windows 2000.
 [2007-11-12 09:38 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 21:01:34 2025 UTC