1--TEST--
2SPL: Test ArrayObject::natsort() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : int ArrayObject::natsort()
6 * Description: proto int ArrayIterator::natsort()
7 Sort the entries by values using "natural order" algorithm.
8 * Source code: ext/spl/spl_array.c
9 * Alias to functions:
10 */
11
12echo "*** Testing ArrayObject::natsort() : basic functionality ***\n";
13
14$ao1 = new ArrayObject(array('boo10','boo1','boo2','boo22','BOO5'));
15$ao2 = new ArrayObject(array('a'=>'boo10','b'=>'boo1','c'=>'boo2','d'=>'boo22','e'=>'BOO5'));
16var_dump($ao1->natsort());
17var_dump($ao1);
18var_dump($ao2->natsort('blah'));
19var_dump($ao2);
20?>
21===DONE===
22--EXPECT--
23*** Testing ArrayObject::natsort() : basic functionality ***
24bool(true)
25object(ArrayObject)#1 (1) {
26  ["storage":"ArrayObject":private]=>
27  array(5) {
28    [4]=>
29    string(4) "BOO5"
30    [1]=>
31    string(4) "boo1"
32    [2]=>
33    string(4) "boo2"
34    [0]=>
35    string(5) "boo10"
36    [3]=>
37    string(5) "boo22"
38  }
39}
40bool(true)
41object(ArrayObject)#2 (1) {
42  ["storage":"ArrayObject":private]=>
43  array(5) {
44    ["e"]=>
45    string(4) "BOO5"
46    ["b"]=>
47    string(4) "boo1"
48    ["c"]=>
49    string(4) "boo2"
50    ["a"]=>
51    string(5) "boo10"
52    ["d"]=>
53    string(5) "boo22"
54  }
55}
56===DONE===
57