Bug #63376 [Opn->Nab]: wrong output
| From: | rasmus@php.net | Date: | Sun, 28 Oct 2012 15:23:59 +0000 |
| Subject: | Bug #63376 [Opn->Nab]: wrong output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174386@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63376&edit=1
ID: 63376
Updated by: rasmus@php.net
Reported by: projektas at gmail dot com
Summary: wrong output
-Status: Open
+Status: Not a bug
Type: Bug
Package: Output Control
Operating System: Linux
PHP Version: 5.3.18
Block user comment: N
Private report: N
New Comment:
Read the explanation in bug #29992
Previous Comments:
------------------------------------------------------------------------
[2012-10-28 14:55:03] projektas at gmail dot com
Description:
------------
I can't understand why I'm getting wrong output
http://codepad.org/nWTjjjV6
Test script:
---------------
<?php
$spell = array("double", "toil", "trouble", "cauldron",
"bubble");
foreach ($spell as &$word) {
$word = ucfirst($word);
echo $word . "\n";
}
echo "---\n";
foreach ($spell as $word) {
echo $word . "\n";
}
Expected result:
----------------
Double
Toil
Trouble
Cauldron
Bubble
---
Double
Toil
Trouble
Cauldron
Bubble
Actual result:
--------------
Double
Toil
Trouble
Cauldron
Bubble
---
Double
Toil
Trouble
Cauldron
Cauldron
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63376&edit=1