Parse Error Syntax Error Unexpected T_ns_separator
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company
Syntax Error, Unexpected T_ns_separator, Expecting ',' Or ';'
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions syntax error, unexpected '\' (t_ns_separator), expecting identifier (t_string) Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers,
Php Class Namespace
just like you, helping each other. Join them; it only takes a minute: Sign up parsing error - syntax error, unexpected T_NS_SEPARATOR [closed] up vote 3 down vote favorite I have this line in PHP: $bom php use != b"\xEF\xBB\xBF" When I run it, I get the error: Parse error: syntax error, unexpected T_NS_SEPARATOR in C:\xampp\htdocs\MediaAlbumWeb\Utils\Utils.php on line 218 What is the T_NS_SEPARATOR in php and why is it unexpected? php error-handling share|improve this question edited Sep 27 '14 at 12:11 Community♦ 11 asked Jun 7 '11 at 9:17 Riaz Mahmood Rajib 1612 closed as too localized by Till Helge, rdlowrey, PeeHaa, Jasper, Ocramius Mar 3 '13 at 15:50 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 1 That line has no parse errors. Paste your entire code if possible or atleast few lines before line 218. –codaddict Jun 7 '11 at 9:20 please show some more code relevant to this. –Gaurav Jun 7 '11 at 9:20 1 just a wild guess: try removing the b before the string. the error message hints at namespaces though –knittl Jun 7 '11 at 9:21 @codaddict Actually, there is a parse error: it's the b, which PHP sees as a constant, followed by a string. The only that'd ever work if there was a concatenation in between ('.'). Nonetheless, I just think the "b" should be left out altogether. –Berry Langerak Jun 7 '11 at 9:24 1 @codaddict, what the... I've never seen this before, but I just tested it on my machine and it actually seems to work. Do you have a link to the documentation
Sign in Pricing Blog Support Search GitHub This repository Watch 21 Star 243 Fork 94 schmittjoh/JMSDiExtraBundle Code Issues 73 Pull requests 16 Projects 0 Pulse Graphs New issue Parse Error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) #184 Closed lsv opened this Issue Nov 26, 2014 · 7 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 3 participants lsv commented Nov 26, 2014 http://stackoverflow.com/questions/6263105/parsing-error-syntax-error-unexpected-t-ns-separator Sometimes I got this in a Symfony 2.5.7 Im not really sure that the bug is in JMS, but its ALWAYS in this file. Here is the cached file https://github.com/schmittjoh/JMSDiExtraBundle/issues/184 public static function inject($container) { $instance = new \\Dcs\OrderBundle\Controller\BasketController(); return $instance; } } Its the double \ thats inflects the problem. The instance file is all green with no errors and all uses are used. NigelGreenway commented Dec 10, 2014 @lsv I have had the same and can confirm it seems to be adding the prefixed \ to both the namespace and the controller FQCN. lsv commented Dec 10, 2014 Im using this to "hotfix" the problem $files = glob(__DIR__ . '/app/cache/*/jms_diextra/controller_injectors/*.php'); foreach($files as $filename){ $file = file_get_contents($filename); $file = str_replace("\\\\
a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers http://magento.stackexchange.com/questions/87756/php-parse-error-syntax-error-unexpected-t-ns-separator-in or posting ads with us Magento Questions Tags Users Badges Unanswered Ask Question _ Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top php Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in [closed] up vote 0 down vote syntax error favorite i am new to php and i am doing some coding i am getting the following error when i used this code : Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in i am not getting what is the error. please help me to find solution php share|improve this question asked Oct 27 '15 at 6:50 Baby in Magento 1,19532669 closed as off-topic by Rajeev K Tomy, Prateek, liyakat, David Manners, Arunendra Oct 27 '15 syntax error, unexpected at 9:35 This question does not appear to be about the Magento e-Commerce platform within the scope defined in the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 4 I'm voting to close this question as off-topic because this is purely a php related question and not specific to magento –Rajeev K Tomy Oct 27 '15 at 6:52 is there any stackoverflow group to post purely related to php questions? –Baby in Magento Oct 27 '15 at 6:55 you can use stackoverflow.com to ask any code related questions. Just put tag - php there. You can also put the tag -magento –Rajeev K Tomy Oct 27 '15 at 6:59 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted you are using single quotes in PHP code and they are not closed properly. change to share|improve this answer answered Oct 27 '15 at 6:51 Marius♦ 113k16151396 i will accept answer in 15 min.... –Baby in Magento Oct 27 '15 at 6:54 add a comment| up vote 1 down vote Remove single quotes from function call To share|improve this answer answered Oct 27 '15 at 6:54 Minesh Patel 1,397214 add a comment| Not the answer