Php Parse Error Syntax Error Unexpected T_class Expecting T_function
Contents |
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes ViewsIssues Parse error: syntax error, unexpected 'class' (t_class) syntax error, unexpected T_CLASS, expecting T_FUNCTION Closed (fixed)Project:ViewsVersion:6.x-3.x-devComponent:CodePriority:NormalCategory:Bug reportAssigned:UnassignedReporter:HTFCreated:April 12, 2011 parse error syntax error unexpected 'class' (t_class) laravel - 17:12Updated:April 26, 2011 - 17:41 Log in or register to update this issue I have just
Parse Error Syntax Error Unexpected 'class' (t_class) Magento
tried updating the Views 6.x-3.x-dev module which was released 12 April. After updating I went to the homepage and saw the following error "Parse error: syntax error,
Parse Error Syntax Error Unexpected 'class' (t_class) Expecting Identifier (t_string)
unexpected T_CLASS, expecting T_FUNCTION in /home/username/public_html/sites/all/modules/views/handlers/views_handler_field.inc on line 1117" I have now reverted to the version which was released 11 April. Incidentally I also went to the site report logs and noticed that I am getting alot "Invalid argument supplied for foreach() in /home/username/public_html/sites/all/modules/views/includes/view.inc on line 1859." messages during the update process. I also found php class these errors yesterday when I updated the same module which you released yesterday Comments Comment #1 merlinofchaos CreditAttribution: merlinofchaos commented April 12, 2011 at 5:18pm Status: Active » Fixed Whoops. Committed a typo. Fixed and pushed. Log in or register to post comments Comment #2 jerdiggity CreditAttribution: jerdiggity commented April 12, 2011 at 5:36pm @Bob3009 (and anyone else having this problem): In the meantime (until the new dev version is rolled), adding a } to line 303 of views/handlers/views_handler_field.inc should hold you over if you'd rather avoid reverting back. Basically (starting with line 300) you want it to go from this: function element_wrapper_classes($row_index = NULL) { $classes = $this->tokenize_value($this->options['element_wrapper_class'], $row_index); return views_css_safe($classes); function option_definition() { to this: function element_wrapper_classes($row_index = NULL) { $classes = $this->tokenize_value($this->options['element_wrapper_class'], $row_index); return views_css_safe($classes); } function option_definition() { @merlin: feel free to yell at me if that's incorrect... Either way, worked for me as a temp fix. :) Log in or register to post comments Comment #3 merlinofchaos CreditAttribution: mer
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
Xampp
this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign https://www.drupal.org/node/1125022 up Parse error: “syntax error, unexpected ';', expecting T_FUNCTION” up vote 2 down vote favorite Sample Code: Config.php: class Config { public $serverIP = "1.1.1.10"; } DB.php: require_once "/home/mysite/PHP/Config.php"; class DB extends Config { //DB related functions here.. } research.php: require_once "/home/mysite/PHP/DB.php"; class research extends DB { // Using DB functions to retrieve information from the research tables. } On executing the research.php http://stackoverflow.com/questions/8411133/parse-error-syntax-error-unexpected-expecting-t-function file, I am getting an error message saying: "Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/mysite/PHP/research.php on line 1". I have checked every possibility that may cause this error. But I couldn't fix it. I have checked few possibilities such as require_once("filepath"); missing braces, etc... php share|improve this question edited Dec 7 '11 at 8:19 mac 22.4k1288104 asked Dec 7 '11 at 6:12 Sougrakpam 43129 add a comment| 4 Answers 4 active oldest votes up vote 0 down vote accepted This is on line 1, which you didn't post Be sure you have space between
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the http://stackoverflow.com/questions/1288837/php-parse-error-syntax-error-unexpected-t-string-expecting-t-function workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join syntax error them; it only takes a minute: Sign up PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION up vote 1 down vote favorite I get this error in my PHP code: PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\Inetpub\wwwroot\webroot\www.novotempo.org.br\lib\Twitter.php on line 54 The line in question: define('DEBUG',false); Searching the net I found that this usually occurs parse error syntax when you´re using PHP 4.xx, but I´m using 5.2.6 (Just checked it using phpinfo()). I tried locally, and in two other external hosts, but it keeps returning the same message. Why does this happen? How can I fix it? php parsing share|improve this question edited Jan 28 at 14:01 legoscia 24.4k94982 asked Aug 17 '09 at 16:03 Douglas Santos Pinto The true problem is probably one one of the lines before it –Greg Aug 17 '09 at 16:05 Can you post more of the code (a few lines above and a few beneath)? –Mike Dinescu Aug 17 '09 at 16:06 Inside a class method, I got this error when I commented an if statement but forgot to comment the closing brace. That put my next line outside of the function definition. It was a call to a static class function, which PHP saw as an unexpected string literal, I suppose. –Buttle Butkus Jan 10 '14 at 1:22 add a comment| 2 Answers 2 active oldest votes up vote 11 do