1--TEST--
2Test natcasesort() function : usage variations - position of internal array pointer
3--FILE--
4<?php
5/* Prototype  : bool natcasesort(array &$array_arg)
6 * Description: Sort an array using case-insensitive natural sort
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Check position of internal array pointer after calling natcasesort()
12 */
13
14echo "*** Testing natcasesort() : usage variations ***\n";
15
16$array_arg = array ('img13', 'img20', 'img2', 'img1');
17
18echo "\n-- Initial Position of Internal Pointer: --\n";
19echo key($array_arg) . " => " . current ($array_arg) . "\n";
20
21echo "\n-- Call natcasesort() --\n";
22var_dump(natcasesort($array_arg));
23var_dump($array_arg);
24
25echo "\n-- Position of Internal Pointer in Passed Array: --\n";
26echo key($array_arg) . " => " . current ($array_arg) . "\n";
27
28echo "Done";
29?>
30
31--EXPECTF--
32*** Testing natcasesort() : usage variations ***
33
34-- Initial Position of Internal Pointer: --
350 => img13
36
37-- Call natcasesort() --
38bool(true)
39array(4) {
40  [3]=>
41  string(4) "img1"
42  [2]=>
43  string(4) "img2"
44  [0]=>
45  string(5) "img13"
46  [1]=>
47  string(5) "img20"
48}
49
50-- Position of Internal Pointer in Passed Array: --
513 => img1
52Done
53