php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #48308 Strongly suggest updating doc page for flock()
Submitted: 2009-05-16 23:25 UTC Modified: 2009-11-19 10:37 UTC
From: gutza at moongate dot ro Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gutza at moongate dot ro
New email:
PHP Version: OS:

 

 [2009-05-16 23:25 UTC] gutza at moongate dot ro
Description:
------------
The documentation page for flock() should clearly state that $handle is symbolically linked.

Reproduce code:
---------------
<?php

$fo = fopen('lockfile.txt','a');

flock($fo,LOCK_EX);

$fo = '';

// Lock is disable

?>

(This is a copy of mallory dot dessaintes at gmail dot com's User Contributed Note on that page)

Expected result:
----------------
Given PHP's usual behavior related to variables, one would expect either that (1) flock() wasn't affected by any subsequent change of $handler, or (2) that this peculiarity would be explicitly documented.

Actual result:
--------------
Neither of the above. If (1) isn't an option, (2) should be implemented -- that is, the documentation should mention this explicitly.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-16 23:48 UTC] gutza at moongate dot ro
Also, the explanation for parameter $operation should NOT read "operation  is one of the following", because that's not true (LOCK_NB should be used with LOCK_SH or LOCK_EX, it doesn't make much sense on its own -- I never bothered to test what it does on its own because that's pretty much absurd).
 [2009-05-17 13:51 UTC] bjori@php.net
Reclassified as documentation problem
 [2009-11-19 10:37 UTC] svn@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=290972
Log: Overwriting handle would release the log (bug #48308)
 [2009-11-19 10:37 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 07:00:02 2026 UTC