Error Unexpected T_class Expecting
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 syntax error, unexpected 'class' (t_class) laravel the company Business Learn more about hiring developers or posting ads with us Stack
Parse Error Syntax Error Unexpected 'class' (t_class) Laravel
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community parse error: syntax error, unexpected t_class, expecting t_string or t_variable or '$' of 4.7 million programmers, just like you, helping each other. Join them; it 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 symfony parse error: syntax error, unexpected 'class' (t_class), expecting identifier (t_string) 3 After installing laravel we get an error: Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or 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
$kernel = $app->make(illuminate\contracts\http\kernel::class);
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 = $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 uninsta
here for a quick overview of the site Help Center Detailed answers to any questions laravel 5 requirements you might have Meta Discuss the workings and policies of this laravel 5.2 php version site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Laravel 5 Php Version
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 http://stackoverflow.com/questions/32205590/laravel-parse-error-syntax-error-unexpected-t-class-expecting-t-string-or-t-v of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP Parse error: syntax error, unexpected T_CLASS up vote 3 down vote favorite I'm new to PHP, and i'm making a forum. all the files work except one file, add_topic.php. It gives me an http://stackoverflow.com/questions/4553401/php-parse-error-syntax-error-unexpected-t-class error saying: Parse error: syntax error, unexpected T_CLASS in /home/a3885465/public_html/add_topic.php on line 25 I know it is probably on the lines: } else{ echo "ERROR"; } mysql_close(); but the whole code is below just in case. If you have any idea, it would be really appreciated, thanks! The Code for add_topic.php $host=""host""; $username="username"; $password="password"; $db_name ="database_name"; $tbl_name="forum_question";// Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get data that sent from form $topic= $_POST['topic']; $detail= $_POST['detail']; $name= $_POST['name']; $email= $_POST['email']; $datetime=date("d/m/y h:i:s");//create date time $sql="INSERT INTO $tbl_name(topic, detail, name, email, datetime)VALUES('$topic', '$detail', '$name', '$email', '$datetime')"; $result=mysql_query($sql); if($result){ echo "Successful
"; echo "View your topic"; else{ echo "ERROR"; } mysql_close(); ?> php html mysql share|improve this question edited Jan 25 at 12:27 easy coder 8721727 asked Dec 29 '10 at 10:46 Niall 2,51531636 There is no occurrence of "class" in the code you show. Please show the exact
Apparel forum Discussions forum Forum record_voice_over Laracasts Podcast forum Laravel Podcast Forum Laravel T_CLASS fatal error when I try composer update T_CLASS fatal error when I try composer update steven@webaki.com — 1 year ago Hello everyone, https://laracasts.com/discuss/channels/laravel/t-class-fatal-error-when-i-try-composer-update?page=1 When I try to update my vendors package after adding new one. I've this message on my production server : $ php composer.phar update -o --no-dev > php artisan clear-compiled PHP Parse error: syntax https://github.com/barryvdh/laravel-debugbar/issues/439 error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/vhosts/mydomain/artisan on line 31 But when I try this command manually : php artisan clear-compiled I've no problem, no syntax error message. My php version is PHP 5.6.10 Could you help me please ! pmall — 1 year ago your artisan file seems messed up. download it from github and replace it. your artisan file seems messed up. download it from github and replace it. Cancel Update Your Reply steven@webaki.com — 1 year ago Thx pmall, but I've the same message with artisan file from github :( Thx syntax error, unexpected pmall, but I've the same message with artisan file from github :( Cancel Update Your Reply niranjan94 — 11 months ago @Webaki type php -v in the terminal. See what the php version is. Laravel 5.1 requires PHP > 5.5.9. @Webaki type ```php -v``` in the terminal. See what the php version is. Laravel 5.1 requires PHP > 5.5.9. Cancel Update Your Reply steven@webaki.com — 11 months ago @niranjan94 In my first message, I've given my php version and the version is PHP 5.6.10, so it's ok for the requirements PHP > 5.5.9 ;-) @niranjan94 In my first message, I've given my php version and the version is PHP 5.6.10, so it's ok for the requirements PHP > 5.5.9 ;-) Cancel Update Your Reply steven@webaki.com — 10 months ago No idea from anybody ? :( No idea from anybody ? :( Cancel Update Your Reply JarekTkaczyk — 10 months ago @Webaki The error says you're running php < 5.5, which doesn't know the ::class constant. I guess you're using LAMP/MAMP whatever with PHP 5.6, but apparently it isn't the case for your php-cli executable used by composer.phar. @Webaki The error says you're running php < 5.5, which doesn't know the `::clas
Sign in Pricing Blog Support Search GitHub This repository Watch 198 Star 3,946 Fork 463 barryvdh/laravel-debugbar Code Issues 143 Pull requests 27 Projects 0 Pulse Graphs New issue bug syntax error, unexpected 'class' (T_CLASS) #439 Closed khaninejad opened this Issue Dec 30, 2015 · 12 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 6 participants khaninejad commented Dec 30, 2015 PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifi er (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ../vendor/barryvdh/laravel-debugbar/src/L aravelDebugbar.php on line 372 laravel 5.0 barryvdh added a commit that closed this issue Dec 30, 2015 barryvdh 3bf871f barryvdh closed this in 3bf871f Dec 30, 2015 Owner barryvdh commented Dec 30, 2015 Does above commit fix it for you? khaninejad commented Dec 30, 2015 No, remote: Error Output: PHP Parse error: syntax error, unexpected 'class' (T_CL ASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ../vendor/barryvd h/laravel-debugbar/src/LaravelDebugbar.php on line 372 remote: khaninejad commented Dec 30, 2015 let me update my composer Owner barryvdh commented Dec 30, 2015 Did you apply above commit? khaninejad commented Dec 30, 2015 [RuntimeException] Error Output: PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ../vendor/barryvdh/laravel-debugbar/src/LaravelDebugbar.php on line 372 Owner barryvdh
… Fixes #439