note 124008 added to function.stat

From: Date: Wed, 03 Jul 2019 08:56:58 +0000
Subject: note 124008 added to function.stat
Groups: php.notes 
Request: Send a blank email to php-notes+get-211468@lists.php.net to get a copy of this message
The description of the stat() function should be changed to: stat — Gives (potentially cached) information about a file Or at least move the small note that explains the caching to the top, before the examples. I've spent 2 days troubleshooting because of this stat caching (mis)feature. Proper documentation may save others from future frustration. At least on linux, the VFS layer already has caching of inodes and similar, so an extra cache in php isn't obviously that useful. When you come across POSIXly named functions like stat(), fstat(), fopen(), fseek(), ftell() and so on, you usually expect them to work like they do in the C programming language, and/or have their deviations from "standard" behavior clearly documented. Not just mentioned in a note below some examples. For standard, common, cross-language/platform functions and system calls, you shouldn't expect people to read through lots of examples (explaining things you already know) in order to reach crucial information about how the function is different from common assumptions. Perhaps php_stat() would have been a better name for this function, like what was done with php_uname()? ---- Server IP: 208.43.231.9 Probable Submitter: 185.85.3.195 (proxied: 82.196.176.22) ---- Manual Page -- http://php.net/manual/en/function.stat.php Edit -- https://master.php.net/note/edit/124008 Del: integrated -- https://master.php.net/note/delete/124008/integrated Del: useless -- https://master.php.net/note/delete/124008/useless Del: bad code -- https://master.php.net/note/delete/124008/bad+code Del: spam -- https://master.php.net/note/delete/124008/spam Del: non-english -- https://master.php.net/note/delete/124008/non-english Del: in docs -- https://master.php.net/note/delete/124008/in+docs Del: other reasons-- https://master.php.net/note/delete/124008 Reject -- https://master.php.net/note/reject/124008 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#211468) next »