Doc #52767 [Opn->Csd]: Invalid doc of FILE_APPEND|LOCK_EX for file_put_contents caused by #48522

From: Date: Wed, 08 Sep 2010 00:18:10 +0000
Subject: Doc #52767 [Opn->Csd]: Invalid doc of FILE_APPEND|LOCK_EX for file_put_contents caused by #48522
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4992@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52767&edit=1 ID: 52767 Updated by: cataphract@php.net Reported by: andrzeje at wit dot edu dot pl Summary: Invalid doc of FILE_APPEND|LOCK_EX for file_put_contents caused by #48522 -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: 5.3.3 -Assigned To: +Assigned To: cataphract Block user comment: N New Comment: Reverses changes made in response to bogus bug #49329 and bogus bug #48522. Previous Comments: ------------------------------------------------------------------------ [2010-09-08 02:17:07] cataphract@php.net Automatic comment from SVN on behalf of cataphract Revision: http://svn.php.net/viewvc/?view=revision&revision=303153 Log: - Reversing changes from revisions 288122 and 282711, which addressed bug #49329 and bug #48522 (bogus bugs). - Closes bug #52767. ------------------------------------------------------------------------ [2010-09-02 20:15:49] andrzeje at wit dot edu dot pl Description: ------------ In bug report #48522 gwynne@php.net said: ------ php-5.3/ext/standard/file.c:614 if (flags & PHP_FILE_APPEND) { mode[0] = 'a'; } else if (flags & LOCK_EX) { Obviously FILE_APPEND and LOCK_EX are mutually exclusive. This is not documented! ------ OBVIOUSLY someone forget to check what is few lines below: ---BEGIN CODE--- if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) { ----END CODE---- It seems that LOCK_EX check is independent of FILE_APPEND. However the docs were "fixed" and now they're telling that LOCK_EX and FILE_APPEND are mutually exclusive. Test script: --------------- --- From manual page: function.file-put-contents --- Expected result: ---------------- ... It's a documentation bug. Actual result: -------------- Once again I say... it's a DOCS bug! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52767&edit=1

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