Parse error in index.php file when uploading to a hosted server

I was developing a site locally using yii2 basic template and when i uploaded it to the shared hosting server I set to document root to site/web i get the following error when i direct to the home page.

Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in …\web\index.php on line 12

Parse error: syntax error, unexpected T_STRING in …\web\index.php on line 12

Here is my line 12 of the index.php file

(new yii\web\Application($config))->run();

http://stackoverflow.com/questions/13388541/php-parse-error-syntax-error-unexpected-t-object-operator

Check the version of the PHP installed on your shared host.

Yea i think that’s the problem. The php version installed is 5.2 and was seeing that yii2 needs >=5.4. Thanks for your input. Will confirm when problem is solved.