xref: /PHP-8.2/ext/standard/tests/file/bug65272.phpt (revision 26dfce7f)
1--TEST--
2Bug #65272: flock() correctly sets wouldblock out param in windows
3--FILE--
4<?php
5
6$file = __DIR__."/flock_bug65272.dat";
7
8$fp1 = fopen($file, "w");
9var_dump(flock($fp1, LOCK_SH));
10
11$fp2 = fopen($file, "r");
12var_dump(flock($fp2, LOCK_EX|LOCK_NB, $wouldblock));
13var_dump($wouldblock);
14
15echo "Done\n";
16?>
17--CLEAN--
18<?php
19$file = __DIR__."/flock_bug65272.dat";
20unlink($file);
21?>
22--EXPECT--
23bool(true)
24bool(false)
25int(1)
26Done
27