Bug #4774: Null character after key name in uksort
| From: | radekg at elektrownia-lagisza dot com dot pl | Date: | Fri, 02 Jun 2000 12:25:56 +0000 |
| Subject: | Bug #4774: Null character after key name in uksort | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20040@lists.php.net to get a copy of this message | ||
From: radekg@elektrownia-lagisza.com.pl
Operating system: Solaris 2.6, probably all
PHP version: 3.0.16
PHP Bug Type: Misbehaving function
Bug description: Null character after key name in uksort
SCRIPT
------
function cmpfunc($a,$b)
{
echo "*$a**$b*<BR>";
echo strtr("*$a**$b*<BR>","\0","_");
if ($a<$b) return -1;
else if ($a==$b) return 0;
else return 1;
}
$a=array("a" => 1, "b" => 2);
uksort($a,cmpfunc);
OUTPUT
------
*a
*a_**b_*
*a
*a_**b_*
CONFIGURE
---------
./configure --with-apxs=/usr/local/bin/apxs \
--with-config-file-path=/usr/local/apache/conf \
--with-pgsql=/usr/local/ --with-gd=$HOME/ \
--with-snmp --with-sysvsem --with-sysvshm
Apache version: 1.3.11
The same thing happens on Linux with PHP 3.0.12.