1--TEST-- 2Test is_readable() function: usage variations - invalid file names 3--SKIPIF-- 4<?php 5require __DIR__ . '/../skipif_root.inc'; 6?> 7--FILE-- 8<?php 9/* Prototype: bool is_readable ( string $filename ); 10 Description: Tells whether the filename is readable. 11*/ 12 13/* test is_executable() with invalid arguments */ 14 15echo "*** Testing is_readable(): usage variations ***\n"; 16 17$file_handle = fopen(__FILE__, "r"); 18unset($file_handle); 19 20echo "\n*** Testing is_readable() on miscelleneous filenames ***\n"; 21$misc_files = array( 22 0, 23 1234, 24 -2.34555, 25 TRUE, 26 FALSE, 27 NULL, 28 " ", 29 @array(), 30 @$file_handle 31); 32/* loop through to test each element in the above array 33 is a readable file */ 34foreach( $misc_files as $misc_file ) { 35 var_dump( is_readable($misc_file) ); 36 clearstatcache(); 37} 38 39echo "Done\n"; 40?> 41--EXPECTF-- 42*** Testing is_readable(): usage variations *** 43 44*** Testing is_readable() on miscelleneous filenames *** 45bool(false) 46bool(false) 47bool(false) 48bool(false) 49bool(false) 50bool(false) 51bool(false) 52 53Warning: is_readable() expects parameter 1 to be a valid path, array given in %s on line %d 54NULL 55bool(false) 56Done 57