php.net |  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
Votes:2
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
 [2008-10-21 19:44 UTC] svenr at selfhtml dot org
Description:
------------
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).

Compare:
http://de.php.net/manual/en/control-structures.foreach.php
http://de.php.net/manual/de/control-structures.foreach.php
http://de.php.net/manual/it/control-structures.foreach.php


Reproduce code:
---------------
The incomplete example in the german and italian version is:
<?php
$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:
<?php
$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
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-22 22:47 UTC] wiesemann@php.net
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] cucinato@php.net
-Assigned To: +Assigned To: cucinato
 [2010-10-23 13:01 UTC] kalle@php.net
-Type: Bug +Type: Documentation Problem
 [2010-10-23 14:24 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2010-10-23 14:24 UTC] kalle@php.net
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: Fri Apr 19 21:01:30 2024 UTC