1--TEST-- 2symlink() using a relative path, and symlink() to a symlink 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) == 'WIN') { 6 die('skip no symlinks on Windows'); 7} 8?> 9--FILE-- 10<?php 11$prefix = __FILE__; 12 13touch($prefix . "_file"); 14 15// symlink to a regular file using a relative dest 16symlink(basename($prefix . "_file"), $prefix . "_link1"); 17 18// symlink to a symlink using a relative path 19symlink(basename($prefix . "_link1"), $prefix . "_link2"); 20 21// symlink to a non-existent path 22@unlink($prefix . "_nonexistent"); 23symlink(basename($prefix . "_nonexistent"), $prefix . "_link3"); 24 25// symlink to a regular file using an absolute path 26symlink($prefix . "_file", $prefix . "_link4"); 27 28// symlink to a symlink using an absolute path 29symlink($prefix . "_link4", $prefix . "_link5"); 30 31var_dump(readlink($prefix . "_link1")); 32var_dump(readlink($prefix . "_link2")); 33var_dump(readlink($prefix . "_link3")); 34var_dump(readlink($prefix . "_link4")); 35var_dump(readlink($prefix . "_link5")); 36 37unlink($prefix . "_link5"); 38unlink($prefix . "_link4"); 39unlink($prefix . "_link3"); 40unlink($prefix . "_link2"); 41unlink($prefix . "_link1"); 42unlink($prefix . "_file"); 43 44?> 45--EXPECTF-- 46%unicode|string%(%d) "symlink_to_symlink.php_file" 47%unicode|string%(%d) "symlink_to_symlink.php_link1" 48%unicode|string%(%d) "symlink_to_symlink.php_nonexistent" 49%unicode|string%(%d) "%s/symlink_to_symlink.php_file" 50%unicode|string%(%d) "%s/symlink_to_symlink.php_link4" 51