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