#46358 [NEW]: foreach with references needs unset (german, italian)
From: svenr at selfhtml dot org
Operating system:
PHP version: Irrelevant
PHP Bug Type: Translation problem
Bug description: foreach with references needs unset (german, italian)
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 bug report at http://bugs.php.net/?id=46358&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46358&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46358&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46358&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46358&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=46358&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46358&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46358&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46358&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46358&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46358&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46358&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46358&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46358&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46358&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46358&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46358&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46358&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46358&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46358&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46358&r=mysqlcfg
Thread (3 messages)
- svenr at selfhtml dot org