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