summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject_ksort_basic1.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/arrayObject_ksort_basic1.phpt')
-rw-r--r--ext/spl/tests/arrayObject_ksort_basic1.phpt43
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/spl/tests/arrayObject_ksort_basic1.phpt b/ext/spl/tests/arrayObject_ksort_basic1.phpt
new file mode 100644
index 000000000..17745c30f
--- /dev/null
+++ b/ext/spl/tests/arrayObject_ksort_basic1.phpt
@@ -0,0 +1,43 @@
+--TEST--
+SPL: Test ArrayObject::ksort() function : basic functionality with array based store
+--FILE--
+<?php
+/* Prototype : int ArrayObject::ksort()
+ * Description: proto int ArrayIterator::ksort()
+ * Sort the entries by key.
+ * Source code: ext/spl/spl_array.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ArrayObject::ksort() : basic functionality ***\n";
+$ao1 = new ArrayObject(array(4,2,3));
+$ao2 = new ArrayObject(array('b'=>4,'a'=>2,'q'=>3, 99=>'x'));
+var_dump($ao1->ksort());
+var_dump($ao1);
+var_dump($ao2->ksort('blah'));
+var_dump($ao2);
+?>
+===DONE===
+--EXPECTF--
+*** Testing ArrayObject::ksort() : basic functionality ***
+bool(true)
+object(ArrayObject)#%d (3) {
+ [0]=>
+ int(4)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+bool(true)
+object(ArrayObject)#%d (4) {
+ ["a"]=>
+ int(2)
+ ["b"]=>
+ int(4)
+ ["q"]=>
+ int(3)
+ [99]=>
+ string(1) "x"
+}
+===DONE===