php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37593 extract() does not work for accented keys
Submitted: 2006-05-25 21:48 UTC Modified: 2006-05-31 18:52 UTC
From: gallard at mmic dot net Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.0.4 OS: Linux Mandriva 2006
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gallard at mmic dot net
New email:
PHP Version: OS:

 

 [2006-05-25 21:48 UTC] gallard at mmic dot net
Description:
------------
Problem seen in PHP5.0.4 
extract() will not extract an array element if the key name 
contain an accented character. In the following example, 
the third element is not extracted. 

Reproduce code:
---------------
$x['aa']=1;
$x['ae']=2;
$x['a?']=3;
$x['af']=4;
extract($x);
print_r( get_defined_vars());

Expected result:
----------------
Array 
( 
    [x] => Array 
        ( 
            [aa] => 1 
            [ae] => 2 
            [a?] => 3 
            [af] => 4 
        ) 
    [aa] => 1 
    [ae] => 2 
    [a?] => 3 
    [af] => 4 
) 
 

Actual result:
--------------
Array 
( 
    [x] => Array 
        ( 
            [aa] => 1 
            [ae] => 2 
            [a?] => 3 
            [af] => 4 
        ) 
 
    [aa] => 1 
    [ae] => 2 
    [af] => 4 
) 
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-30 09:58 UTC] tony2001@php.net
What if you try with this array?
$x['aq']=1;
$x['aw']=2;
$x['a?']=3;
$x['az']=4;

And with a newer PHP version?
 [2006-05-30 16:14 UTC] gallard at mmic dot net
Supplementary note:  
The problem only happen in apache environment.  
There is no problem if executed in CLI mode.
 [2006-05-30 16:19 UTC] tony2001@php.net
Which means in the locale used by Apache symbols e(accented) and e are equal.
Which is not PHP problem.
 [2006-05-31 18:48 UTC] gallard at mmic dot net
Toni wrote: 
"Which means in the locale used by Apache symbols 
e(accented) and e are equal." 
The following variation shows that the problem is not 
related to an equality to 'e'. 
$x['aq']=1; 
$x['aw']=2; 
$x['a?']=3; 
$x['az']=4; 
have the same problem. Third item is not extracted. 
 
I also checked on another server 
(Apache1.3.33+php4.3.10-16). The problem does not happen. 
 
I do not have access to a more recent version of PHP. Can 
somebody else try it?
 [2006-05-31 18:52 UTC] gallard at mmic dot net
I was wrong. The problem also happen with PHP4.3.10-16
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 06:01:34 2025 UTC