1--TEST-- 2Test symlink(), linkinfo(), link() and is_link() functions : error conditions - symlink & linkinfo 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) == 'SUN') { 6 die('skip Not valid for Sun Solaris'); 7} 8?> 9--FILE-- 10<?php 11// create temp $filename and create link $linkname to it 12$filename = __DIR__."/symlink_link_linkinfo_is_link_error1.tmp"; 13$fp = fopen($filename, "w"); // create temp file 14fclose($fp); 15 16// linkname used to create soft/hard link 17$linkname = __DIR__."/symlink_link_linkinfo_is_link_link_error1.tmp"; 18 19echo "*** Testing symlink() for error conditions ***\n"; 20 21//invalid arguments 22var_dump( symlink('', $linkname) ); // empty string as filename 23var_dump( symlink(false, $linkname) ); // boolean false as filename 24var_dump( symlink($filename, '') ); // '' as linkname 25var_dump( symlink($filename, false) ); // false as linkname 26 27echo "\n*** Testing linkinfo() for error conditions ***\n"; 28 29//invalid arguments 30var_dump( linkinfo('') ); // empty string as linkname 31var_dump( linkinfo(false) ); // boolean false as linkname 32 33echo "Done\n"; 34?> 35--CLEAN-- 36<?php 37unlink(__DIR__."/symlink_link_linkinfo_is_link_error1.tmp"); 38@unlink(__DIR__."/symlink_link_linkinfo_is_link_link_error1.tmp"); 39?> 40--EXPECTF-- 41*** Testing symlink() for error conditions *** 42 43Warning: symlink(): %s in %s on line %d 44bool(false) 45 46Warning: symlink(): %s in %s on line %d 47bool(false) 48 49Warning: symlink(): %s in %s on line %d 50bool(false) 51 52Warning: symlink(): %s in %s on line %d 53bool(false) 54 55*** Testing linkinfo() for error conditions *** 56 57Warning: linkinfo(): %s in %s on line %d 58int(-1) 59 60Warning: linkinfo(): %s in %s on line %d 61int(-1) 62Done 63