|  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
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.
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 01:01:31 2024 UTC