1--TEST-- 2Test posix_access() function test error conditions 3--DESCRIPTION-- 4checks if posix_access() failes for wrong permissions 5--CREDITS-- 6Moritz Neuhaeuser, info@xcompile.net 7PHP Testfest Berlin 2009-05-10 8--SKIPIF-- 9<?php 10if (!extension_loaded('posix')) { 11 die('SKIP The posix extension is not loaded.'); 12} 13if (posix_geteuid() == 0) { 14 die('SKIP Cannot run test as root.'); 15} 16?> 17--INI-- 18safe_mode = 1 19--FILE-- 20<?php 21$filename = dirname(__FILE__) . '/foo.test'; 22var_dump(posix_access($filename, POSIX_F_OK)); 23$fp = fopen($filename,"w"); 24fwrite($fp,"foo"); 25fclose($fp); 26 27chmod ($filename, 0000); 28var_dump(posix_access($filename, POSIX_R_OK)); 29var_dump(posix_access($filename, POSIX_W_OK)); 30var_dump(posix_access($filename, POSIX_X_OK)); 31?> 32===DONE=== 33--CLEAN-- 34<?php 35$filename = dirname(__FILE__) . '/foo.test'; 36chmod ($filename, 0700); 37unlink($filename); 38?> 39--EXPECTF-- 40Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line %d 41bool(false) 42bool(false) 43bool(false) 44bool(false) 45===DONE=== 46