The x mode for fopen() should fail when called twice, as the first call should create the file.
$a = fopen('fs://test.flag', 'x');
$b = fopen('fs://test.flag', 'x');
if (is_resource($a)) {
echo 'a';
fclose($a);
}
if (is_resource($b)) {
echo 'b';
fclose($b);
}
Expected result:
a
fopen(): failed to open stream: File exists
Actual result:
ab
The
xmode forfopen()should fail when called twice, as the first call should create the file.Expected result:
Actual result: