从PHP5迁移到PHP7后,我看到以下错误
PHP Notice: Array to string conversion in /data/get.php on line 25
PHP Notice: Undefined property: stdClass::$Array in /data/get.php on line 25
PHP Notice: Trying to get property 'file' of non-object in /data/get.php on line 25
PHP Warning: include(): Filename cannot be empty in /data/get.php on line 25
PHP Warning: include(): Failed opening '' for inclusion ( include_path='.:/apps/php-7.2.9/lib/php') in /data/get.php on line 25
以下是代码行
` $arr_no_security = array("casestudy","homesharepins", "videotour", "questionengine","casestudysplash");
$security_check = (!in_array($_GET['section'],$arr_no_security));
require_once('includes/app.php');
if(!Security::is_error())
{
if (isset($_GET['section']))
{
include('sections/section.header.inc.php');
$bln_file_included = false;
foreach ($config->application_data->get as $section => $value)
{
if (strtolower($_GET['section']) == strtolower($section)) {
$bln_file_included = true;
include($config->application_data->get->$_GET['section']->file);
}
最后一行是第25行
任何解决此问题的建议
答案 0 :(得分:2)
$config->application_data->get->$_GET['section']->file
应该是
$config->application_data->get->{$_GET['section']}->file
请参阅:http://php.net/manual/en/migration70.incompatible.php “对变量处理的更改”部分