运行此代码两次:
原文链接:https://www.f2er.com/php/134800.html$fp = @fopen('test.test',"wb"); if (flock($fp,LOCK_NB | LOCK_EX)){ @fwrite($fp,$data); echo 'written'; sleep(5); }else{ echo 'skipped,ok'; } @flock($fp,LOCK_UN); @fclose($fp);
总是给我“写”的输出
意味着跳过LOCK_NB,任何线索(在winbdows和unix上)
编辑(2012-03-29仍未修复):https://bugs.php.net/bug.php?id=54453&edit=3 PHP Bug#54453