On Mon, 2 Apr 2001, Andrei Zmievski wrote:
> On Mon, 02 Apr 2001, Alexander Feldman wrote: > Hi, > > These are the
> results and questions from some tests I run yesterday on the > last
> 4.0.5 release candidate. Note that all differences are from PHP >
> 4.0.4pl1. > > 1. The function array_flip($array) puts one extra zero
> byte at the end of > each element in the return array thus making the
> result non binary safe.
>
> I've just fixed it in CVS.
Great.
>
> > 3. The count_chars() function returns different result from the
> 4.0.4pl1 > count_chars() function.
>
> Examples?
Ok, now I analyzed the output more carefully - the problem had been in
4.0.4 - the count_chars function there doesn't create element for the byte
with value 255. This is fixed here - I do not expect problems with this
function (BTW, it doesn't seem to be widely used)...
Attached is a script that reproduces the difference.
>
> -Andrei
>
> "The only true currency in this bankrupt world is what we share with
> each other when we're uncool." -- Lester Bangs, from the film 'Almost
> Famous'
>
Thanks:
-- Alex
for ($i = 0; $i <= 4; $i++) {
$res = count_chars("Mary had a little lamb and she loved it so.", $i);
if (is_array($res)) {
foreach ($res as $x =>; $y)
print("$x($y) ");
print("\n");
} else {
if (4 == $i)
$res = addcslashes($res, "\0..\377");
print("$res\n");
}
}
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]