1--TEST--
2Regression: sort() eq but different len.
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7/*
8 * Test sorting strings that have different length but otherwise equal.
9 */
10
11function sort_using_locale( $locale, $test_array )
12{
13    $coll = ut_coll_create( $locale );
14
15    // Sort array.
16    ut_coll_sort( $coll, $test_array );
17
18    // And return the sorted array.
19    return dump( $test_array ) . "\n";
20}
21
22function ut_main()
23{
24    $res_str = '';
25
26    // Define a couple of arrays.
27    // Each array contains equal strings that differ only in their length.
28    $a1 = array( 'aa', 'aaa', 'a' );
29    $a2 = array( 'пп', 'ппп', 'п' );
30
31    // Sort them.
32    $res_str .= sort_using_locale( 'en_US', $a1 );
33    $res_str .= sort_using_locale( 'ru_RU', $a2 );
34
35    return $res_str;
36}
37
38require_once( 'ut_common.inc' );
39ut_run();
40?>
41--EXPECT--
42array (
43  0 => 'a',
44  1 => 'aa',
45  2 => 'aaa',
46)
47array (
48  0 => 'п',
49  1 => 'пп',
50  2 => 'ппп',
51)
52