xref: /PHP-5.5/ext/standard/tests/file/bug65272.phpt (revision f2f467bd)
1--TEST--
2Bug #65272: flock() correctly sets wouldblock out param in windows
3--SKIPIF--
4<?php
5if (stripos(PHP_OS, 'win') !== 0) die("skip windows required");
6?>
7--FILE--
8<?php
9
10$file = dirname(__FILE__)."/flock.dat";
11
12$fp1 = fopen($file, "w");
13var_dump(flock($fp1, LOCK_SH));
14
15$fp2 = fopen($file, "r");
16var_dump(flock($fp2, LOCK_EX|LOCK_NB, $wouldblock));
17var_dump($wouldblock);
18
19@unlink($file);
20echo "Done\n";
21?>
22--EXPECTF--
23bool(true)
24bool(false)
25int(1)
26Done
27