Doc #81028 [Opn->Ver]: touch() with wrappers
Edit report at https://bugs.php.net/bug.php?id=81028&edit=1
ID: 81028
Updated by: cmb@php.net
Reported by: sh-ya at ya dot ru
Summary: touch() with wrappers
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: Documentation problem
PHP Version: 7.4.19
Block user comment: N
Private report: N
New Comment:
Frankly, that[1] looks like a bug to me (albeit one we should not
fix in a revision, and perhaps not in a minor). touch() is
supposed to modify the atime (even when called without parameter),
and to create the file if it does not exist, but that certainly
won't work for HTTP URLs (and generally not for non writable
wrappers).
[1] <https://github.com/php/php-src/blob/php-7.4.19/ext/standard/filestat.c#L671>
[2] <https://www.php.net/manual/en/function.touch.php#refsect1-function.touch-description>
Previous Comments:
------------------------------------------------------------------------
[2021-05-10 19:22:45] sh-ya at ya dot ru
Description:
------------
it seems we can check URLs with touch(), but it's undocumented.
Test script:
---------------
var_dump(touch('https://bugs.php.net/'),
touch('https://bugs.php.net/null'));
Actual result:
--------------
bool(true)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81028&edit=1
Thread (3 messages)