1--TEST-- 2Test symlink(), linkinfo(), link() and is_link() functions : usage variations - hardlink to non-existent file 3--FILE-- 4<?php 5/* Variation 2 : Create hard link to non-existent file */ 6 7$file_path = __DIR__; 8// non-existing filename 9$non_existent_file = "$file_path/non_existent_file_variation2.tmp"; 10// non-existing linkname 11$non_existent_linkname = "$file_path/non_existent_linkname_variation2.tmp"; 12 13echo "*** Creating a hard link to a non-existent file ***\n"; 14// creating hard link to non_existent file 15var_dump( link($non_existent_file, $non_existent_linkname) ); // expected false 16 17// checking linkinfo() and is_link() on the link; expected: false 18var_dump( linkinfo($non_existent_linkname) ); 19var_dump( is_link($non_existent_linkname) ); 20 21echo "Done\n"; 22?> 23--EXPECTF-- 24*** Creating a hard link to a non-existent file *** 25 26Warning: link(): No such file or directory in %s on line %d 27bool(false) 28 29Warning: linkinfo(): No such file or directory in %s on line %d 30int(-1) 31bool(false) 32Done 33