当不需要分号时,我在 PHP 中收到解析错误代码
I am getting a parse error code in PHP when the semi-colon is not needed
我一直在研究这个错误,但仍然不知道如何解决这个问题。我也对如何防止这个问题再次发生感到好奇和好奇。我正在使用 Cloud 9 IDE。我正在使用初始化文件并将清理这些文件。它说明我的 'host' => '127.0.0.1',
之后需要有一个分号
我还尝试了 PHP 验证器/Lint。仍然是越野车并给我错误。
我从 IDE 得到的错误是:
Syntax error, unexpected ';' expecting ')'
如您所见,我没有分号。
init.php
<?php
session_start();
$GLOBALS['config'] = array(
'mysql' => array(
'host' => '127.0.0.1', ;
'username' => 'porixify',
'password' => '',
'db' => 'vomica'
),
'remember' => array(
'cookie_name' => 'hash',
'cookie_expiry' => 604800
),
'session' => array(
'session_name' => 'user'
)
);
spl_autoload_register(function($class)
{
require_once 'Classes/' . $class . '.php';
});
require_once 'Functions/santize.php';
?>
看看这一行:
'host' => '127.0.0.1', ;
那里 是 一个分号....沿线很远,第 ~500 列。
删除它,删除空格,瞧:
'host' => '127.0.0.1',
是的,对,第 7 行('host' => '127.0.0.1',
之后)第 496 列有分号。只需在 editor/ide 中打开换行,您就会看到。
我一直在研究这个错误,但仍然不知道如何解决这个问题。我也对如何防止这个问题再次发生感到好奇和好奇。我正在使用 Cloud 9 IDE。我正在使用初始化文件并将清理这些文件。它说明我的 'host' => '127.0.0.1',
我还尝试了 PHP 验证器/Lint。仍然是越野车并给我错误。
我从 IDE 得到的错误是:
Syntax error, unexpected ';' expecting ')'
如您所见,我没有分号。
init.php
<?php
session_start();
$GLOBALS['config'] = array(
'mysql' => array(
'host' => '127.0.0.1', ;
'username' => 'porixify',
'password' => '',
'db' => 'vomica'
),
'remember' => array(
'cookie_name' => 'hash',
'cookie_expiry' => 604800
),
'session' => array(
'session_name' => 'user'
)
);
spl_autoload_register(function($class)
{
require_once 'Classes/' . $class . '.php';
});
require_once 'Functions/santize.php';
?>
看看这一行:
'host' => '127.0.0.1', ;
那里 是 一个分号....沿线很远,第 ~500 列。
删除它,删除空格,瞧:
'host' => '127.0.0.1',
是的,对,第 7 行('host' => '127.0.0.1',
之后)第 496 列有分号。只需在 editor/ide 中打开换行,您就会看到。