|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #39065 undocumented: symlink() changes behaviour depending on ZTS
Submitted: 2006-10-06 14:39 UTC Modified: 2011-04-08 21:37 UTC
Avg. Score:4.2 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:3 (75.0%)
From: phpbugs at triphoenix dot de Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.2.2 OS: Unix
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: phpbugs at triphoenix dot de
New email:
PHP Version: OS:


 [2006-10-06 14:39 UTC] phpbugs at triphoenix dot de
The symlink() function changes its behaviour depending on the ZTS define. If ZTS is not defined, all are created relative, if ZTS is enabled, the parameters are evaluated to actual absolute directories and thus are created absolute. This is different behaviour and should be at least documented in a proper way. 

Reproduce code:
symlink("..", "testlink");

Expected result:
Depending on enabled or disabled ZTS the symlink will be created relative (pointing to "..") or absolute (e.g. if currently in "/tmp/test/phptest" pointing to "/tmp/test"). If the link (or the directory containing it) is being moved/renamed later, the latter can lead to a broken link while the first cannot.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-10 16:32 UTC] brunofr at ioda dot net
Same issue pb sur php 5.2.2
 [2007-08-17 16:25 UTC]
It should behave same.
 [2011-04-08 21:37 UTC]
-Package: Feature/Change Request +Package: Filesystem function related
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Oct 02 10:05:51 2022 UTC