1--TEST-- 2Test lchown() function : basic functionality 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) == 'WIN') die('skip no windows support'); 6if (!function_exists("posix_getuid")) die("skip no posix_getuid()"); 7?> 8--FILE-- 9<?php 10/* Prototype : bool lchown (string filename, mixed user) 11 * Description: Change file owner of a symlink 12 * Source code: ext/standard/filestat.c 13 * Alias to functions: 14 */ 15 16echo "*** Testing lchown() : basic functionality ***\n"; 17$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; 18$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; 19 20$uid = posix_getuid(); 21 22var_dump( touch( $filename ) ); 23var_dump( symlink( $filename, $symlink ) ); 24var_dump( lchown( $filename, $uid ) ); 25var_dump( fileowner( $symlink ) === $uid ); 26 27?> 28===DONE=== 29--CLEAN-- 30<?php 31 32$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; 33$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; 34unlink($filename); 35unlink($symlink); 36 37?> 38--EXPECTF-- 39*** Testing lchown() : basic functionality *** 40bool(true) 41bool(true) 42bool(true) 43bool(true) 44===DONE=== 45