1--TEST-- 2Test finfo_file() function : basic functionality 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7/* Prototype : string finfo_file(resource finfo, char *file_name [, int options [, resource context]]) 8 * Description: Return information about a file. 9 * Source code: ext/fileinfo/fileinfo.c 10 * Alias to functions: 11 */ 12 13$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic'; 14$finfo = finfo_open( FILEINFO_MIME ); 15 16echo "*** Testing finfo_file() : basic functionality ***\n"; 17 18// Calling finfo_file() with all possible arguments 19var_dump( finfo_file( $finfo, __FILE__) ); 20var_dump( finfo_file( $finfo, __FILE__, FILEINFO_CONTINUE ) ); 21var_dump( finfo_file( $finfo, $magicFile ) ); 22 23?> 24===DONE=== 25--EXPECTF-- 26*** Testing finfo_file() : basic functionality *** 27string(28) "text/x-php; charset=us-ascii" 28string(22) "PHP script, ASCII text" 29string(32) "text/plain; charset=unknown-8bit" 30===DONE=== 31