php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36495 array_change_key_case problem with utf8
Submitted: 2006-02-23 09:58 UTC Modified: 2006-02-23 13:02 UTC
From: b dot puttmann at dbap dot de Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2006-02-23 09:58 UTC] b dot puttmann at dbap dot de
Description:
------------
array_change_key_case does not change array keys when utf8 encoded.

PHP Version 4.3.10

'./configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/apache/conf' '--with-apxs=/usr/local/apache/bin/apxs' '--with-sybase-ct=/opt/sybase' '--with-ldap=/usr' '--with-gdbm=/usr' '--with-dba' '--enable-shmop' '--enable-sysvsem' '--with-gd' '--with-zlib-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-imap=./imap-patched' '--enable-sockets' '--with-freetype-dir=/usr' '--with-dom'

Reproduce code:
---------------
Testcase:

$test_array = array(	"?ber" => 1,
 			"?ber" => 2);
print "<pre>";print_r($test_array);print "</pre>";
$test_array = array_change_key_case($test_array,CASE_LOWER);
print "<pre>";print_r($test_array);print "</pre>";

Expected result:
----------------
Array
(
    [?ber] => 1
    [?ber] => 2
)

Array
(
    [?ber] => 2
)

Actual result:
--------------
Array
(
    [?ber] => 1
    [?ber] => 2
)

Array
(
    [?ber] => 1
    [?ber] => 2
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-23 10:01 UTC] b dot puttmann at dbap dot de
Corrected PHP Version
 [2006-02-23 10:02 UTC] derick@php.net
This is simply not supported. It will be supported in PHP 6.
 [2006-02-23 13:02 UTC] b dot puttmann at dbap dot de
Oh well, blame me ;-) 
Thanks for the fast reply though!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 13:01:28 2024 UTC