Error Unexpected T_class
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 Business Learn more about hiring developers syntax error, unexpected 'class' (t_class) laravel or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x parse error syntax error unexpected 'class' (t_class) laravel Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it parse error syntax error unexpected t_class expecting t_string or t_variable or '$' in laravel only takes a minute: Sign up Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE up vote 9 down vote favorite 3 After installing laravel we get an error: Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or
Symfony Parse Error: Syntax Error, Unexpected 'class' (t_class), Expecting Identifier (t_string)
T_VARIABLE or '$' in C:\xampp\htdocs\laravel\public\index.php on line 50 laravel-5 share|improve this question edited Aug 25 '15 at 14:26 Gigi 896 asked Aug 25 '15 at 13:39 rajkishor saw 49112 Your PHP version? –idmean Aug 25 '15 at 13:43 add a comment| 2 Answers 2 active oldest votes up vote 21 down vote Laravel 5.1 uses the ::class property to get string representations of a fully qualified classname. The error you're seeing is caused by this line $kernel = parse error syntax error unexpected 'class' (t_class) magento $app->make(Illuminate\Contracts\Http\Kernel::class); This language feature has been introduced in PHP 5.5 which is a requirement of Laravel 5.1. Your installed PHP version is probably older than 5.5. Try to update your PHP binary. In case you are interested in why ::class is used, take a look at this answer share|improve this answer answered Aug 25 '15 at 13:58 lukasgeiter 52.5k783105 I am using php 5.6.0, but still i am getting Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in C:\wamp\www\laravelmaster\public\index.php on line 50 , i checked from cmd like php -v and using laravel 5.2 –151291 May 30 at 9:52 3 @151291 Your CLI version of php (the one you get with php -v) might be different from the one the webserver uses. Put phpinfo() in a PHP file and open it in your browser. There you should see the actual version your server uses... –lukasgeiter May 30 at 13:05 add a comment| up vote 0 down vote Your PHP version on your Xampp is lower than 5.5.9 as specified in the Laravel 5.1 doc. Simply uninstall your current Xampp software and download a fresh copy at Apache website with this specification 5.6.12 / PHP 5.6.12 . Do not forget to collaborate with your host provider to ensure that your hosting account runs the required PHP version (>=5.5.9) during the deployment of your Laravel 5.1 app online.
in PHP Forum View Course » View http://stackoverflow.com/questions/32205590/laravel-parse-error-syntax-error-unexpected-t-class-expecting-t-string-or-t-v Exercise 455 points Submitted by Catherine almost 2 years ago passed but "Parse error: syntax error, unexpected T_CLASS on line 11" on the https://www.codecademy.com/en/forum_questions/547d310b9c4e9df069000cfb screen class Person{ public $isAlive = true; public $firstname; public $lastname; public $age; } $teacher = new Person(); $student = new Person(); echo $teacher->isAlive; > 2 votes permalink problem solved isAlive; ?> 455 points Submitted by Catherine almost 2 years ago
that make connections all over the world. Join today Download & https://www.drupal.org/node/1125022 Extend Drupal Core Distributions Modules Themes ViewsIssues Parse error: 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 - 17:12Updated:April 26, 2011 - 17:41 Log in or register to update this issue I have just tried updating the Views 6.x-3.x-dev module which was released syntax error 12 April. After updating I went to the homepage and saw the following error "Parse error: syntax error, 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 unexpected 'class' (t_class) 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 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