Error: unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING

0 votes

Hii,

I get this error:

"Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in [wordpress dir]/wp-content/themes/[my-theme]/functions.php on line 14"

And line 14 is just a simple use command...

Line 13-15:

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

This is client's site and it works just fine on my test site.

so I wanted to know what is the cause of error?

May 8 in PHP by kartik
• 11,890 points
147 views

1 answer to this question.

0 votes

Hello @kartik,

Make sure they are running Latest Version of PHP is 5.2 or later. If they are running an earlier version they won't have support for namespaces.

Hope this work!!

Thank You!!

answered May 8 by Niroj
• 23,950 points

Related Questions In PHP

0 votes
1 answer

Error: Global Variable is not accessable to local function

Hey kartik, A variable declared outside a function has a ...READ MORE

answered Feb 19 in PHP by Niroj
• 23,950 points
37 views
0 votes
1 answer

Error:“Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP

Hello @kartik, The best way for getting input string is: $value ...READ MORE

answered Apr 1 in PHP by Niroj
• 23,950 points
375 views
0 votes
1 answer

Error:PDOException SQLSTATE[HY000] [2020] No such file or directory in php?

Hello, I checked php -i | grep pdo and noticed ...READ MORE

answered Apr 2 in PHP by Niroj
• 23,950 points
36 views
0 votes
1 answer

Composer install error - requires ext_curl when it's actually enabled?

Hello, on php7 run for example: > sudo apt-get ...READ MORE

answered Apr 2 in PHP by Niroj
• 23,950 points
57 views
0 votes
1 answer

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

answered Mar 27 in PHP by Niroj
• 23,950 points
41 views
0 votes
1 answer

Connection with MySQL server using PHP. How can we do that?

Hey @kartik, You have to provide MySQL hostname, ...READ MORE

answered Mar 27 in PHP by Niroj
• 23,950 points
44 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27 in PHP by Niroj
• 23,950 points
36 views
0 votes
1 answer

What are the differences between mysqli_connect and mysqli_pconnect?

Hello, mysqli_pconnect() function is used for making a persistence ...READ MORE

answered Mar 27 in PHP by Niroj
• 23,950 points
78 views
0 votes
1 answer

PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR

Hello @kartik, Change your syntax because it  was invalid. Updated syntax: $purchaseOrder = ...READ MORE

answered May 19 in PHP by Niroj
• 23,950 points
47 views
0 votes
1 answer

How can you display the error messages?

Hey, In the HTML form, we add ...READ MORE

answered Feb 13 in PHP by Niroj
• 23,950 points
46 views