|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-03-07 12:13 UTC] sniper@php.net
[2003-03-10 13:35 UTC] moriyoshi@php.net
[2003-06-16 10:44 UTC] stas@php.net
[2003-06-17 10:51 UTC] sniper@php.net
[2003-07-17 17:11 UTC] helly@php.net
[2003-07-18 07:48 UTC] sniper@php.net
[2003-07-24 15:14 UTC] sniper@php.net
[2009-09-21 13:32 UTC] svn@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 07:00:01 2025 UTC |
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.