-
Notifications
You must be signed in to change notification settings - Fork 7.8k
PHP runner does exit if script file is locked #18272
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
Comments
Can't reproduce on Linux. Maybe @cmb69 can confirm? |
I can reproduce this on my Windows machine as well. Minimal repro: <?php
$handle = fopen(__FILE__, 'r');
var_dump(flock($handle, LOCK_EX));
sleep(5);
echo "done\n"; Steps to reproduce:
|
Tried @mvorisek script on |
When opcache is loaded & enabled for CLI, ie. the repro script is run like
the problem does not exist even on Windows. |
Here is explanation of this issue: repro: <?php
$handle = fopen(__FILE__, 'r');
var_dump(flock($handle, LOCK_EX));
var_dump(file_get_contents(__FILE__)); which outputs on Windows:
If file is locked, even from the same php process, it is read as empty string /wo any failure! |
Description
The following code:
How to reproduce
a.php
php -n a.php
php -n a.php
Result
Expected output
PHP Version
PHP 8.2.5 (cli) (built: Apr 12 2023 08:41:53) (ZTS Visual C++ 2019 x86)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
with Zend OPcache v8.2.5, Copyright (c), by Zend Technologies
Tested also on PHP 7.4 and that's the same there.
Operating System
Microsoft Windows [Version 10.0.19045.5679]
The text was updated successfully, but these errors were encountered: