Annotation of embedaddon/php/ext/spl/tests/arrayObject_ksort_basic2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: Test ArrayObject::ksort() function : basic functionality with object base store
3: --FILE--
4: <?php
5: /* Prototype : int ArrayObject::ksort()
6: * Description: proto int ArrayIterator::ksort()
7: * Sort the entries by key.
8: * Source code: ext/spl/spl_array.c
9: * Alias to functions:
10: */
11:
12: echo "*** Testing ArrayObject::ksort() : basic functionality ***\n";
13: Class C {
14: public $x = 'prop1';
15: public $z = 'prop2';
16: public $a = 'prop3';
17: private $b = 'prop4';
18: }
19:
20: $c = new C;
21: $ao1 = new ArrayObject($c);
22: var_dump($ao1->ksort());
23: var_dump($ao1, $c);
24: ?>
25: ===DONE===
26: --EXPECTF--
27: *** Testing ArrayObject::ksort() : basic functionality ***
28: bool(true)
29: object(ArrayObject)#2 (1) {
30: ["storage":"ArrayObject":private]=>
31: object(C)#1 (4) {
32: ["b":"C":private]=>
33: string(5) "prop4"
34: ["a"]=>
35: string(5) "prop3"
36: ["x"]=>
37: string(5) "prop1"
38: ["z"]=>
39: string(5) "prop2"
40: }
41: }
42: object(C)#1 (4) {
43: ["b":"C":private]=>
44: string(5) "prop4"
45: ["a"]=>
46: string(5) "prop3"
47: ["x"]=>
48: string(5) "prop1"
49: ["z"]=>
50: string(5) "prop2"
51: }
52: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>