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--EXPECTF-- 31*** Testing natcasesort() : usage variations *** 32 33-- Initial Position of Internal Pointer: -- 340 => img13 35 36-- Call natcasesort() -- 37bool(true) 38array(4) { 39 [3]=> 40 string(4) "img1" 41 [2]=> 42 string(4) "img2" 43 [0]=> 44 string(5) "img13" 45 [1]=> 46 string(5) "img20" 47} 48 49-- Position of Internal Pointer in Passed Array: -- 503 => img1 51Done 52