Bug #79632 [NEW]: var_dump'ed array produce sometimes error on require/include
| From: | cgold dot vie at gmail dot com | Date: | Mon, 25 May 2020 16:20:18 +0000 |
| Subject: | Bug #79632 [NEW]: var_dump'ed array produce sometimes error on require/include | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227155@lists.php.net to get a copy of this message | ||
From: cgold dot vie at gmail dot com
Operating system: Debian 9
PHP version: 7.3.18
Package: Unknown/Other Function
Bug Type: Bug
Bug description:var_dump'ed array produce sometimes error on require/include
Description:
------------
PHP 7.3.17-1+0~20200419.57+debian9~1.gbp0fda17
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:
-----------
<?php
$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?
--
Edit bug report at https://bugs.php.net/bug.php?id=79632&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79632&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79632&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79632&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79632&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79632&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79632&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79632&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79632&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79632&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79632&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79632&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79632&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79632&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79632&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79632&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79632&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79632&r=mysqlcfg