xref: /PHP-7.3/ext/standard/tests/array/bug44929.phpt (revision 9c5af4e4)
1--TEST--
2Bug #44929 (natsort doesn't handle leading zeros well)
3--FILE--
4<?php
5$a = array('001','008','005','00011','03','000014','-123','0.002','00','0','0_0','0-0');
6natsort($a);
7var_dump($a);
8?>
9--EXPECT--
10array(12) {
11  [6]=>
12  string(4) "-123"
13  [8]=>
14  string(2) "00"
15  [9]=>
16  string(1) "0"
17  [11]=>
18  string(3) "0-0"
19  [7]=>
20  string(5) "0.002"
21  [10]=>
22  string(3) "0_0"
23  [0]=>
24  string(3) "001"
25  [4]=>
26  string(2) "03"
27  [2]=>
28  string(3) "005"
29  [1]=>
30  string(3) "008"
31  [3]=>
32  string(5) "00011"
33  [5]=>
34  string(6) "000014"
35}
36