Affected page
https://www.php.net/manual/en/function.flock.php#refsect1-function.flock-examples
Issue description
https://wiki.php.net/rfc/marking_return_value_as_important updated flock
to mark its return value as NoDiscard
. However, the documented usage of the function is precisely discarding the return value of flock($fp, LOCK_UN)
when releasing the lock
Steps to reproduce
- Go to https://www.php.net/manual/en/function.flock.php#refsect1-function.flock-examples
- Copy the code of the first example
- Execute that code with PHP 8.5-dev
Suggested fix
The documented usage of the function should correspond to a usage that does not trigger warnings (or the warning should be removed)