Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] the documented usage of flock triggers warnings in PHP 8.5 #4581

Closed
stof opened this issue Apr 3, 2025 · 1 comment · Fixed by php/php-src#18255
Closed

[Bug] the documented usage of flock triggers warnings in PHP 8.5 #4581

stof opened this issue Apr 3, 2025 · 1 comment · Fixed by php/php-src#18255
Labels
bug Documentation contains incorrect information

Comments

@stof
Copy link
Contributor

stof commented Apr 3, 2025

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

  1. Go to https://www.php.net/manual/en/function.flock.php#refsect1-function.flock-examples
  2. Copy the code of the first example
  3. 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)

@stof stof added the bug Documentation contains incorrect information label Apr 3, 2025
@TimWolla
Copy link
Member

TimWolla commented Apr 4, 2025

Related to php/php-src#18235.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Documentation contains incorrect information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants