Edit report at https://bugs.php.net/bug.php?id=60933&edit=1

 ID:                 60933
 Comment by:         carloschilazo at gmail dot com
 Reported by:        m...@php.net
 Summary:            Testing asort with SORT_LOCALE_STRING fails on Mac
                     OS X 10.6
 Status:             Open
 Type:               Bug
 Package:            Arrays related
 Operating System:   Mac OS X 10.6
 PHP Version:        5.4SVN-2012-01-30 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

I think this goes waaay back to: 41758

And bug 41758 is in status Won't fix, I couldn't find why.

Is there a reason behind this?

Thanks


Previous Comments:
------------------------------------------------------------------------
[2012-01-30 13:50:47] m...@php.net

Description:
------------
The test ext/standard/tests/array/locale_sort.phpt fails. 
"Île-du-Prince-Édouard" 
is sorted to the end of the array, instead of the expected 3rd position.

Test script:
---------------
<?php                                                                           
setlocale(LC_ALL, 'fr_FR', 'fr_FR.ISO8859-1');                                  
$table = array("AB" => "Alberta",                                               
"BC" => "Colombie-Britannique",                                                 
"MB" => "Manitoba",                                                             
"NB" => "Nouveau-Brunswick",                                                    
"NL" => "Terre-Neuve-et-Labrador",                                              
"NS" => "Nouvelle-Écosse",                                                     
 
"ON" => "Ontario",                                                              
"PE" => "Île-du-Prince-Édouard",                                              
  
"QC" => "Québec",                                                              
 
"SK" => "Saskatchewan",                                                         
"NT" => "Territoires du Nord-Ouest",                                            
"NU" => "Nunavut",                                                              
"YT" => "Territoire du Yukon");                                                 
asort($table, SORT_LOCALE_STRING);                                              
var_dump($table);

Expected result:
----------------
array(13) {                                                                     
  ["AB"]=>                                                                      
  string(7) "Alberta"                                                           
  ["BC"]=>                                                                      
  string(20) "Colombie-Britannique"                                             
  ["PE"]=>                                                                      
  string(21) "Île-du-Prince-Édouard"                                          
  
  ["MB"]=>                                                                      
  string(8) "Manitoba"                                                          
  ["NB"]=>                                                                      
  string(17) "Nouveau-Brunswick"                                                
  ["NS"]=>                                                                      
  string(15) "Nouvelle-Écosse"                                                 
 
  ["NU"]=>                                                                      
  string(7) "Nunavut"                                                           
  ["ON"]=>                                                                      
  string(7) "Ontario"                                                           
  ["QC"]=>                                                                      
  string(6) "Québec"                                                           
 
  ["SK"]=>                                                                      
  string(12) "Saskatchewan"                                                     
  ["NL"]=>                                                                      
  string(23) "Terre-Neuve-et-Labrador"                                          
  ["YT"]=>                                                                      
  string(19) "Territoire du Yukon"                                              
  ["NT"]=>                                                                      
  string(25) "Territoires du Nord-Ouest"

Actual result:
--------------
array(13) {                                                                     
                                                                                
                                                   
  ["AB"]=>                                                                      
  string(7) "Alberta"                                                           
  ["BC"]=>                                                                      
  string(20) "Colombie-Britannique"                                             
  ["MB"]=>                                                                      
  string(8) "Manitoba"                                                          
  ["NB"]=>                                                                      
  string(17) "Nouveau-Brunswick"                                                
  ["NS"]=>                                                                      
  string(15) "Nouvelle-Écosse"                                                 
 
  ["NU"]=>                                                                      
  string(7) "Nunavut"                                                           
  ["ON"]=>                                                                      
  string(7) "Ontario"                                                           
  ["QC"]=>                                                                      
  string(6) "Québec"                                                           
 
  ["SK"]=>                                                                      
  string(12) "Saskatchewan"                                                     
  ["NL"]=>                                                                      
  string(23) "Terre-Neuve-et-Labrador"                                          
  ["YT"]=>                                                                      
  string(19) "Territoire du Yukon"                                              
  ["NT"]=>                                                                      
  string(25) "Territoires du Nord-Ouest"                                        
  ["PE"]=>                                                                      
  string(21) "Île-du-Prince-Édouard"                                          
  
} 


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60933&edit=1

Reply via email to