#46358 [Opn]: [IT] foreach with references needs unset

From: Date: Wed, 22 Apr 2009 22:47:42 +0000
Subject: #46358 [Opn]: [IT] foreach with references needs unset
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2154@lists.php.net to get a copy of this message
ID: 46358 Updated by: wiesemann@php.net -Summary: [DE][IT]foreach with references needs unset (german, italian) Reported By: svenr at selfhtml dot org Status: Open Bug Type: Translation problem PHP Version: Irrelevant New Comment: There is currently no German translation for foreach. (It was available, but isn't anymore) => Only IT translation might be affected. Previous Comments: ------------------------------------------------------------------------ [2008-10-21 19:44:14] 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 ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46358&edit=1

« previous php.doc.bugs (#2154) next »