Doc #52767 [NEW]: Invalid doc of FILE_APPEND|LOCK_EX for file_put_contents caused by #48522

From: Date: Thu, 02 Sep 2010 18:15:49 +0000
Subject: Doc #52767 [NEW]: Invalid doc of FILE_APPEND|LOCK_EX for file_put_contents caused by #48522
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4962@lists.php.net to get a copy of this message
From: Operating system: PHP version: 5.3.3 Package: Documentation problem Bug Type: Documentation Problem Bug description:Invalid doc of FILE_APPEND|LOCK_EX for file_put_contents caused by #48522 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 bug report at http://bugs.php.net/bug.php?id=52767&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52767&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52767&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52767&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52767&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52767&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52767&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52767&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52767&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52767&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52767&r=support Expected behavior: http://bugs.php.net/fix.php?id=52767&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52767&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52767&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52767&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52767&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52767&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52767&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52767&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52767&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52767&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52767&r=mysqlcfg

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