running this code twice :
$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);
always gives me the output of "written"
Means the LOCK_NB
is skipped , any clues (on both winbdows and unix)
EDIT (2012-03-29 still not fixed): https://bugs.php.net/bug.php?id=54453&edit=3 PHP Bug #54453