Show symlinks in stack trace file paths
Open
Nobody has claimed this yet.
Category: Engine
Feature
Status: Needs Triage
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Summary
Stack trace (from debug_backtrace(), exceptions, errors ..) shows always absolute/real/evaluated file paths, even though the script was run from symlink context.
How to reproduce
- Create a directory "d2" and a symlink to that directory "d1"
mkdir D:\d2
mklink /D "D:\d1" "D:\d2"
- Create a "D:\d2\test.php" script
<?php
var_dump($argv);
(function(){
var_dump(debug_backtrace());
})();
- Run the script using symlink path
php.exe D:\d1\test.php
Current behavior
array(1) {
[0]=>
string(14) "D:\d1\test.php"
}
array(1) {
[0]=>
array(4) {
["file"]=>
string(14) "D:\d2\test.php"
["line"]=>
int(8)
["function"]=>
string(9) "{closure}"
["args"]=>
array(0) {
}
}
}
Expected behavior
array(1) {
[0]=>
string(14) "D:\d1\test.php"
}
array(1) {
[0]=>
array(4) {
["file"]=>
string(14) "D:\d1\test.php"
["line"]=>
int(8)
["function"]=>
string(9) "{closure}"
["args"]=>
array(0) {
}
}
}
...
PHP Version
8.3.9
Operating System
Windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the Windows reproduction with php.exe, debug_backtrace(), exceptions, and errors as the starting entry points. Compare argv and stack-trace file paths when invoking D:\d1\test.php through the symlink. Done means the reported paths consistently retain the symlink path for the described cases, with existing behavior checked for regressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100