Doc #79467 [PATCH]: file_put_contents can't create file with data:// wrappers

From: Date: Sat, 02 May 2020 15:39:50 +0000
Subject: Doc #79467 [PATCH]: file_put_contents can't create file with data:// wrappers
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17552@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79467&edit=1 ID: 79467 Patch added by: cmb@php.net Reported by: j7ur8 at qq dot com Summary: file_put_contents can't create file with data:// wrappers Status: Verified Type: Documentation Problem Package: Streams related Operating System: windows Linux PHP Version: 7.4.4 Block user comment: N Private report: N New Comment: The following pull request has been associated: Patch Name: Fix #79467: data:// wrappers are writable On GitHub: https://github.com/php/php-src/pull/5511 Patch: https://github.com/php/php-src/pull/5511.patch Previous Comments: ------------------------------------------------------------------------ [2020-04-15 10:28:31] nikic@php.net Looks like internally data stream uses temp stream: https://github.com/php/php-src/blob/99084262c3f56dd8a4efa6fa689441966745440f/main/streams/memory.c#L622 I do wonder whether it shouldn't be better to drop write support there than to document it, as it doesn't really make sense to me for data streams. ------------------------------------------------------------------------ [2020-04-11 17:50:48] peehaa@php.net Why would it create a file? ------------------------------------------------------------------------ [2020-04-11 16:13:51] j7ur8 at qq dot com but it dont create a file. ------------------------------------------------------------------------ [2020-04-11 15:49:47] cmb@php.net It seems the docs are wrong: <https://3v4l.org/9HKq6>. ------------------------------------------------------------------------ [2020-04-11 15:22:04] peehaa@php.net According to the docs https://www.php.net/manual/en/wrappers.data.php#refsect1-wrappers.data-options writing is not supported so seems to be working as designed. If anything it shouldn't say it wrote 4 bytes instead. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=79467 -- Edit this bug report at https://bugs.php.net/bug.php?id=79467&edit=1

« previous php.doc.bugs (#17552) next »