ID:               26514
 Updated by:       [EMAIL PROTECTED]
 Reported By:      grandadmirale at yahoo dot com
 Status:           Bogus
 Bug Type:         Variables related
 Operating System: WinXP
 PHP Version:      4.3.4
 New Comment:

Hint: Try change the echo line to:

echo $test, "\n";




Previous Comments:
------------------------------------------------------------------------

[2003-12-04 02:08:44] [EMAIL PROTECTED]

This is exactly what 'static' does..

RTFM:
http://www.php.net/manual/en/language.variables.scope.php


------------------------------------------------------------------------

[2003-12-03 14:53:21] grandadmirale at yahoo dot com

Description:
------------
When using static variables and the .= operand, the static variable
doubles itself.

Reproduce code:
---------------
function test()
{
   static $test = '';
   $test .= 'lala|';
   echo $test;
}

test();
test();
test();

Expected result:
----------------
lala|lala|lala|

Actual result:
--------------
lala|lala|lala|lala|lala|lala|


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26514&edit=1

Reply via email to