#22592 [Csd->Opn]: Cascading assignments to strings with curly braces broken
ID: 22592
Updated by: helly@php.net
Reported By: matteo at beccati dot com
-Status: Closed
+Status: Open
Bug Type: Scripting Engine problem
-Operating System: Debian GNU/Linux 3.0
+Operating System: *
-PHP Version: 4.3.2-dev 5CVS-2003-03-11
+PHP Version: 4.3.3-dev
New Comment:
Reopen since it leaks now
Previous Comments:
------------------------------------------------------------------------
[2003-06-17 10:51:26] sniper@php.net
Also fixed in PHP 4.3.3-dev (latest STABLE snapshot..)
------------------------------------------------------------------------
[2003-06-16 10:44:19] stas@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Fixed in ZE2.
------------------------------------------------------------------------
[2003-03-10 13:35:45] moriyoshi@php.net
Update version
------------------------------------------------------------------------
[2003-03-07 12:13:25] sniper@php.net
Happens also with 4.3.2-dev. (from today)
------------------------------------------------------------------------
[2003-03-07 11:40:25] matteo at beccati dot com
When using cascading assignments to strings and curly braces, to change
characters within strings, only the last character is changed to the
right value. Other characters become NUL (0x00).
<?
$wrong = $correct = 'abcdef';
$correct{1} = '*';
$correct{3} = '*';
$correct{5} = '*';
// This produces the
$wrong{1} = $wrong{3} = $wrong{5} = '*';
echo $correct."\n".$wrong."\n\n";
echo urlencode($correct)."\n"."\n".urlencode($wrong)."\n";
?>
The resulting output is:
a*c*e*
ace*
a%2Ac%2Ae%2A
a%00c%00e%2A
I also tested it on a old PHP 4.2.0-dev, and it gives the same result.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22592&edit=1
Thread (10 messages)