4

I developed a laravel application back in August this year, and it was working fine then. I am trying to run that application now, and it returns this error:

parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '{' or '$' in D:\bkonme\artisan line 31

And line 31 is like this:

$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

My PHP version is 5.6.14 and I am using XAMPP on windows platform. I have some idea of it happening because of some version conflict between laravel and PHP, but i don't know how to resolve that issue, any help?

10
  • 1
    install a fresh piece of laravel and put ur controller, model etc there mybe will work not sure just idea. Commented Dec 1, 2015 at 12:20
  • can you show a bit more code before line 31? You probably have forgotten to close a tag or write a Semicolon ; Commented Dec 1, 2015 at 12:21
  • This is going to be a hell lot of work to do, i want some simple solution! Commented Dec 1, 2015 at 12:21
  • I don't see how this should be connected to some version. class is a reserved word in php. It cannot be used as valid identifier for some property or similar. Commented Dec 1, 2015 at 12:21
  • 2
    Are you 100% sure you are running php 5.6? @arkascha available from 5.5 up: php.net/manual/en/… Commented Dec 1, 2015 at 12:24

1 Answer 1

2

Even if you have PHP/5.6.14 installed, your app is definitively not using it. You could not use class as identifier until PHP/5.5 (demo).

The feature is called Class name resolution via ::class and it's described in the Migrating from PHP 5.4.x to PHP 5.5.x chapter of the PHP manual.

Sign up to request clarification or add additional context in comments.

1 Comment

Well, yes, you are right, i checked my PHP version through CMD and it came out to be 5.4, coz another instance of XAMPP was installed and the path of that instance was added in the path variables, Thanks Mate!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.