The PHP Function fstat
The php function fstat retrieves information about a file using the file pointer. It returns an array of integers and string indices. This array can be sorted to find the value you need, or used with foreach to iterate over every element.
If a file is a symbolic link, fstat(symlink) does not return any information about it; instead, use lstat(symlink). The fstat() function works only on local files, not URLs passed to fopen( ) or popen( ).
The function uses the underlying stat(2) system call and is therefore expensive. To minimize overhead, PHP caches the result. If you change a file's permissions and call stat() again, the new values may not be visible until the cache is flushed by calling clearstatcache( ).
PHP and Daylight Savings
It has come to my attention that on Windows systems, the 'atime' and'mtime' elements returned by fstat() (and by other functions such as fileatime()) do not reflect the actual date of the file modification properly because of the way Windows handles daylight savings time. This is a bug in the way those functions work on Windows and should be fixed in future versions of PHP.
PHP 8.2 allows developers to mark method parameters with the