go to bug id or search bugs for
Linux debian 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1 (2020-01-20) x86_64 GNU/Linux -> On VirtualBox (Host Win7) using Shared Directories.
I am not 100% sure why this error happens:
I use the following code to dump an array to a file (its something like a cache system):
file_put_contents($_SERVER['BASE_DIR'].'website/siteconfig/'.$row['domain'].'.php', '<?php'.PHP_EOL.'$CONFIG = ' . $save . ';', LOCK_EX);
the result looks like:
$CONFIG = array (
'id' => '1',
'created' => '2020-05-25 00:00:41',
'lastupdate' => '2020-05-25 17:46:16',
'tmpl_id' => '1',
'showperpage' => '18',
'phrases' => '0',
'hashtags' => '1',
'maxpages' => 2,
and the error on including using require():
Parse error: syntax error, unexpected ')', expecting end of file in /srv/myproject/website/siteconfig/testsite.local.php on line 11
Line 11 is: );
This error does not appear every time when i update the testsite.local.php using var_dump. Sometimes it happens, sometimes not.
If this error happens i have to delete the file manually and then execute my var_dump again. Then it is working again. If i update without to delete the old file, the same error stay.
Maybe its some problem with the OPcache?
Add a Patch
Add a Pull Request
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Note that flocks are advisory locks, so the read operation must also acquire a shared lock. Obviously include does not do that, so it may see partially written files. What you likely want is an atomic rename.
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.