|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40548 SplFileInfo::getOwner/getGroup give a warning on broken symlink
Submitted: 2007-02-19 20:58 UTC Modified: 2007-02-20 13:08 UTC
From: info at adaniels dot nl Assigned: helly (profile)
Status: Closed Package: SPL related
PHP Version: 5.2.1 OS: Linux/Ubuntu
Private report: No CVE-ID: None
 [2007-02-19 20:58 UTC] info at adaniels dot nl
SplFileInfo::getOwner() and SplFileInfo::getGroup() give a warning on broken symlink. This is probably due the fact that the function follows the symlink. 

Reproduce code:
system: ln -s nothing /broken

	$fi = new SplFileInfo('/broken');
	echo $fi->getOwner();
	echo $fi->getGroup();

Expected result:

Actual result:
Warning: SplFileInfo::getOwner() [function.SplFileInfo-getOwner]: stat failed for /broken in /home/arnold/projects/jasny/jasny-explorer/webroot/index.php on line 6

Warning: SplFileInfo::getGroup() [function.SplFileInfo-getGroup]: stat failed for /broken in /home/arnold/projects/jasny/jasny-explorer/webroot/index.php on line 7


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-20 06:27 UTC] judas dot iscariote at gmail dot com
I expect an Exception in that case..
 [2007-02-20 13:08 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Throwsexception now
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jul 05 07:05:46 2022 UTC