php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19531 is_link returns empty string in all cases.
Submitted: 2002-09-20 16:15 UTC Modified: 2002-09-20 17:48 UTC
From: kevincarlson at houston dot rr dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4CVS-2002-09-20 OS: Slackware Linux 8.0
Private report: No CVE-ID: None
 [2002-09-20 16:15 UTC] kevincarlson at houston dot rr dot com
from CVS for 200209132100

Loop through a directory or set your own variables and:

$erk = is_link($dirname."/".$file);
$erk2 = @readlink($dirname."/".$file);
echo "Checking file=$dirname/$file<br> -LinkStatus=$erk<br> --Readlink=$erk2<br>";

produces for me on a directory containing a link:

Checking file=/share/web/slinks/htdocs
-LinkStatus=
--Readlink=/usr/local/apache2/manual/

So Readlink() works, is_link() does not.  Funky huh?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-20 17:46 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Try it with any other symlinks see if it works, if it does, check file permissions on /usr/local/apache2/manual/.
 [2002-09-20 17:48 UTC] sniper@php.net
is_link() returns boolean and readlink() returns a string..
That's why it's empty. Try doing 'var_dump(is_link("some_link"));' and it should be clear.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Aug 17 03:00:03 2025 UTC