note 124008 deleted from function.stat by thiago

From: Date: Wed, 03 Jul 2019 12:48:11 +0000
Subject: note 124008 deleted from function.stat by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211469@lists.php.net to get a copy of this message
Note Submitter: Mattias Bergvall ---- 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()?

« previous php.notes (#211469) next »