Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 错误分析错误:语法错误,意外的T_字符串,应为T_常量\u封装的\u字符串_Php_Wordpress - Fatal编程技术网

Php 错误分析错误:语法错误,意外的T_字符串,应为T_常量\u封装的\u字符串

Php 错误分析错误:语法错误,意外的T_字符串,应为T_常量\u封装的\u字符串,php,wordpress,Php,Wordpress,我得到这个错误: “分析错误:语法错误,意外的T_字符串,在第14行的[wordpress dir]/wp content/themes/[my theme]/functions.php中应为T_常量_封装的_字符串或“(”” 第14行只是一个简单的use命令 第13-15行: add_action('headway_setup_child_theme', array('HeadwaySchematic', 'init'), 1); use mfbcaptheme\mobilebrowserth

我得到这个错误:

“分析错误:语法错误,意外的T_字符串,在第14行的[wordpress dir]/wp content/themes/[my theme]/functions.php中应为T_常量_封装的_字符串或“(””

第14行只是一个简单的
use
命令

第13-15行:

add_action('headway_setup_child_theme', array('HeadwaySchematic', 'init'), 1);
use mfbcaptheme\mobilebrowsertheme;
require_once 'mobilebrowsertheme.php';

这是在客户端站点上,在我的测试站点上运行正常……不确定是什么导致了此错误。

请确保他们运行的是PHP 5.3或更高版本。如果他们运行的是早期版本,他们将不支持名称空间。

因此,您没有看到任何语法错误?必须是PHP VersionTanks。这修复了我的问题。这是其中之一这些答案让我突然意识到。请重新打开这个问题。这个问题的答案-将PHP 5.2升级到5.3在2013年与很多人相关,今天仍然相关。因此它可能会帮助未来的访问者。