Annotation of embedaddon/php/ext/spl/tests/arrayObject_ksort_basic1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: Test ArrayObject::ksort() function : basic functionality with array based 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: $ao1 = new ArrayObject(array(4,2,3));
! 14: $ao2 = new ArrayObject(array('b'=>4,'a'=>2,'q'=>3, 99=>'x'));
! 15: var_dump($ao1->ksort());
! 16: var_dump($ao1);
! 17: var_dump($ao2->ksort('blah'));
! 18: var_dump($ao2);
! 19: ?>
! 20: ===DONE===
! 21: --EXPECTF--
! 22: *** Testing ArrayObject::ksort() : basic functionality ***
! 23: bool(true)
! 24: object(ArrayObject)#1 (1) {
! 25: ["storage":"ArrayObject":private]=>
! 26: array(3) {
! 27: [0]=>
! 28: int(4)
! 29: [1]=>
! 30: int(2)
! 31: [2]=>
! 32: int(3)
! 33: }
! 34: }
! 35: bool(true)
! 36: object(ArrayObject)#2 (1) {
! 37: ["storage":"ArrayObject":private]=>
! 38: array(4) {
! 39: ["a"]=>
! 40: int(2)
! 41: ["b"]=>
! 42: int(4)
! 43: ["q"]=>
! 44: int(3)
! 45: [99]=>
! 46: string(1) "x"
! 47: }
! 48: }
! 49: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>