Return to array_keys_variation_005.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_keys() function (variation - 5) 3: --FILE-- 4: <?php 5: 6: echo "\n*** Testing array_keys() with resource type ***\n"; 7: $resource1 = fopen( __FILE__, "r"); 8: $resource2 = opendir( "." ); 9: 10: /* creating an array with resource types as elements */ 11: $arr_resource = array($resource1, $resource2); 12: 13: var_dump(array_keys($arr_resource, $resource1)); // loose type checking 14: var_dump(array_keys($arr_resource, $resource1, TRUE)); // strict type checking 15: var_dump(array_keys($arr_resource, $resource2)); // loose type checking 16: var_dump(array_keys($arr_resource, $resource2, TRUE)); // strict type checking 17: 18: /* Closing the resource handles */ 19: fclose( $resource1 ); 20: closedir( $resource2 ); 21: 22: ?> 23: --EXPECTF-- 24: *** Testing array_keys() with resource type *** 25: array(1) { 26: [0]=> 27: int(0) 28: } 29: array(1) { 30: [0]=> 31: int(0) 32: } 33: array(1) { 34: [0]=> 35: int(1) 36: } 37: array(1) { 38: [0]=> 39: int(1) 40: }