|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-10 12:04 UTC] fa@php.net
-Status: Open
+Status: Feedback
[2010-06-10 12:04 UTC] fa@php.net
[2010-06-10 12:26 UTC] scarduzio at gmail dot com
-Status: Feedback
+Status: Open
[2010-06-10 12:26 UTC] scarduzio at gmail dot com
[2010-06-10 14:50 UTC] fa@php.net
[2015-04-12 21:19 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2015-04-12 21:19 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 07:00:01 2025 UTC |
Description: ------------ When I try to write any length string with fwrite using a file handle I previously locked with flock, fwrite is of course unable to write, but will return unexplicable value 1 instead of false. Test script: --------------- /* Run two instances of this script in a rapid sequence */ $fp1 = fopen("/cache/lockable.txt","w"); if(flock($fp1, LOCK_EX | LOCK_NB)){ echo "locked fp1\n"; sleep(20); }else{ $res = fwrite($fp1, "ABCDE"); if(false === $res){ echo "failed the write\n"; } echo "I managed! fwrite returned: "; print_r($res); } Expected result: ---------------- I expect to read "failed to write" when a second instance of the script is run, since fwrite should return false as documentation says when fwrite is not able to write. Actual result: -------------- fwrite returns integer 1.