1--TEST-- 2Test fileperms() function: usage variations - invalid filenames 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--CONFLICTS-- 6obscure_filename 7--FILE-- 8<?php 9/* Testing fileperms() with invalid arguments -int, float, bool, NULL, resource */ 10 11$file_path = __DIR__; 12 13echo "*** Testing Invalid file types ***\n"; 14$filenames = array( 15 /* Invalid filenames */ 16 -2.34555, 17 " ", 18 "", 19 TRUE, 20 FALSE, 21 NULL, 22 23 /* scalars */ 24 1234, 25 0 26); 27 28/* loop through to test each element the above array */ 29foreach( $filenames as $filename ) { 30 var_dump( fileperms($filename) ); 31 clearstatcache(); 32} 33?> 34--CLEAN-- 35<?php 36$file_path = __DIR__; 37unlink($file_path."/fileperms_variation2.tmp"); 38?> 39--EXPECTF-- 40*** Testing Invalid file types *** 41 42Warning: fileperms(): stat failed for -2.34555 in %s on line %d 43bool(false) 44 45Warning: fileperms(): stat failed for in %s on line %d 46bool(false) 47bool(false) 48 49Warning: fileperms(): stat failed for 1 in %s on line %d 50bool(false) 51bool(false) 52bool(false) 53 54Warning: fileperms(): stat failed for 1234 in %s on line %d 55bool(false) 56 57Warning: fileperms(): stat failed for 0 in %s on line %d 58bool(false) 59