|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46358 [IT] foreach with references needs unset
Submitted: 2008-10-21 19:44 UTC Modified: 2010-10-23 14:24 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: svenr at selfhtml dot org Assigned: cucinato (profile)
Status: Closed Package: Translation problem
PHP Version: Irrelevant OS:
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: svenr at selfhtml dot org
New email:
PHP Version: OS:


 [2008-10-21 19:44 UTC] svenr at selfhtml dot org
The german and italian translation of the foreach construct with reference variable have shortened the illustrative source code (or are outdated and based on an earlier version).


Reproduce code:
The incomplete example in the german and italian version is:
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
    $value = $value * 2;
// $arr vale ora array(2, 4, 6, 8)

Expected result:
The complete source code example in the english version is:
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
    $value = $value * 2;
// $arr is now array(2, 4, 6, 8)
unset($value); // break the reference with the last element


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-22 22:47 UTC]
There is currently no German translation for foreach. (It was available, but isn't anymore) => Only IT translation might be affected.
 [2010-04-07 02:23 UTC]
-Assigned To: +Assigned To: cucinato
 [2010-10-23 13:01 UTC]
-Type: Bug +Type: Documentation Problem
 [2010-10-23 14:24 UTC]
-Status: Assigned +Status: Closed
 [2010-10-23 14:24 UTC]
Closing this one as the foreach construct currently aren't translated anymore, this will be fixed once the file is re-translated.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 08:03:12 2021 UTC