xref: /PHP-8.0/ext/standard/tests/file/bug41815.phpt (revision f8d79582)
1--TEST--
2Bug #41815 (Concurrent read/write fails when EOF is reached)
3--FILE--
4<?php
5
6$filename = __DIR__."/concur_rw.txt";
7
8@unlink($filename);
9$writer = fopen($filename, "wt");
10$reader = fopen($filename, "r");
11fread($reader, 1);
12fwrite($writer, "foo");
13
14if (strlen(fread($reader, 10)) > 0) {
15    echo "OK\n";
16}
17
18fclose($writer);
19fclose($reader);
20
21@unlink($filename);
22
23echo "Done\n";
24?>
25--EXPECT--
26OK
27Done
28