Comments (13)
I cannot reproduce with php 8.3.6 nor with 8.3.8, would you have a reproducer or give more details regarding your case ?
from doc-en.
I also have this issue on another server with centos 7 and php 8.3.8.
It's just a symlink created using symlink() that I want to delete after I get the size.
from doc-en.
There might be more to it. e.g. are you getting a symlink from a shared (virtualised ?) folder ? network mountpoint ?
from doc-en.
Nope it's a symlink to a file in the same folder.
But it might be that the target file is deleted before the symlink itself.
from doc-en.
It might thus
would you have a reproducer or give more details regarding your case ?
from doc-en.
$file = tempnam(sys_get_temp_dir(), '');
$symlink = $file . '.symlink';
symlink('./' . basename($file), $symlink);
unlink($file);
var_dump(filesize($symlink));
from doc-en.
sure ... looking at php_stat, it seems to behave "as expected', now I m torn between bug and "feature request to change longtime behavior".
from doc-en.
Yeah I didn't expect it to behave like this, I thought filesize would show size of the file supplied and not the target file of a symlink, would've made more sense to do filesize(realpath()) if target file size was needed🤔
Well probably because in most cases filesize of a symlink would be irrelevant😅
from doc-en.
I don't think we can change this. I would not consider it as a bug. This would require RFC to get changed.
from doc-en.
@RV7PR, are you interested in pursuing the RFC process?
from doc-en.
@cmb69 Not really... maybe we should just add a note for filesize() and SplFileInfo::getSize() specifiying that it always uses the target file of a symlink and if the filesize is needed for a symlink that lstat()['size'] should be used and that if target file does not exists anymore it generates a warning.
from doc-en.
Well, I'm fine with transferring this to doc-en (so the documentation could be updated). Any objections?
from doc-en.
I'm okay with that
from doc-en.
Related Issues (20)
- Example page in manual for Error Handling uses old/deprecated code HOT 1
- Documentation for preg_match and preg_match_all flag PREG_OFFSET_CAPTURE wrong
- uopz_compose is not listed as `deprecated` in the sidebar HOT 2
- Remove XForms documentation
- sem_get add warning about freeing variable HOT 1
- hash_algos() docs should clarify which algos are cryptographic HOT 11
- MariaDB support in documentation HOT 11
- `strcmp` falsely claims it returns a 0, 1 or -1 HOT 1
- Typo Enums HOT 1
- mismatch between array_walk(_recursive) return type in stub and documentation HOT 1
- Destructuring assignment from null does not raise warning HOT 1
- Potential deprecated list of "Experimental Extensions" HOT 1
- Ip Configuration
- .
- Document when PHP automatically sets the $previous value in new Throwables
- .
- Unreferenced Class names HOT 2
- coordinates do not work HOT 1
- extract(): argument #1 is not passed by reference HOT 1
- Wrong Example in SplFixedArray docs HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doc-en.