Return to array_change_key_case_variation5.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_change_key_case() function : usage variations - position of internal pointer 3: --FILE-- 4: <?php 5: /* Prototype : array array_change_key_case(array $input [, int $case]) 6: * Description: Retuns an array with all string keys lowercased [or uppercased] 7: * Source code: ext/standard/array.c 8: */ 9: 10: /* 11: * Check the position of the internal array pointer after calling the function 12: */ 13: 14: echo "*** Testing array_change_key_case() : usage variations ***\n"; 15: 16: $input = array ('one' => 'un', 'two' => 'deux', 'three' => 'trois'); 17: 18: echo "\n-- Call array_change_key_case() --\n"; 19: var_dump($result = array_change_key_case($input, CASE_UPPER)); 20: 21: echo "-- Position of Internal Pointer in Result: --\n"; 22: echo key($result) . " => " . current($result) . "\n"; 23: echo "\n-- Position of Internal Pointer in Original Array: --\n"; 24: echo key($input) . " => " . current ($input) . "\n"; 25: 26: echo "Done"; 27: ?> 28: 29: --EXPECTF-- 30: *** Testing array_change_key_case() : usage variations *** 31: 32: -- Call array_change_key_case() -- 33: array(3) { 34: ["ONE"]=> 35: string(2) "un" 36: ["TWO"]=> 37: string(4) "deux" 38: ["THREE"]=> 39: string(5) "trois" 40: } 41: -- Position of Internal Pointer in Result: -- 42: ONE => un 43: 44: -- Position of Internal Pointer in Original Array: -- 45: one => un 46: Done