2017-07-29 82 views
2

对于下面的线,我面对的错误:解析错误,意想不到的“[”只在生产服务器

Parse error, unexpected '[' ..etc.

$totalEmail = array_merge($other_email,[$_SESSION['user_email']]); 

此错误仅发生生产服务器,而不是在测试服务器上。

+0

你确定它是相同的代码吗? – Difster

+0

是的, <?php if($ agreement_type =='bulkimporter'){ $ totalEmail = array_merge($ other_email,[$ _ SESSION ['user_email']]); ? \t> –

回答

6

This error is only occurring on production server, not the testing server.

这是因为你的生产服务器运行PHP 5.4以上年长所以它并不了解新的数组语法([]),认为它是无效的,因此,语法错误,你面对的。要么升级您的生产机器至少使用PHP 5.4(但也是旧的,所以我会升级到7.1),或者修复代码以使用旧的数组语法(array())。

+0

谢谢 下面用现在: $ totalEmail = array_merge($ OTHER_EMAIL,阵列($ _ SESSION [ 'USER_EMAIL'])); –

相关问题