0

I'm having issues why this issue arose out of nowhere, the script I use hasn't been updated, nor the php server configuration has changed but I'm getting this erorr today

I upgraded my server to Php ver 5.6 from the standard 5.4 and this has fixed the issue, why did the ver stop processing this class all of a sudden?

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in

This is making use of kernel and this line is the app being run

I understand what a parse error and syntax error after reading, but the real question is why has this only become an issue now? The line used has no unexpected class from what I know and this server has been running 5.4 without issue up until today

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

As you can see it's making use of kernel correctly, only an upgrade to php5.6 has fixed the issue which makes no sense to me, did something become redundant all of a sudden that has altered the way 5.4 handles my request?

Tom Hutchison
  • 73
  • 1
  • 1
  • 6
  • 1
    Sounds like code dependent on 5.5 features. Perhaps `ClassName::class`? – ficuscr Jun 13 '17 at 22:04
  • @ficuscr The code has been running on 5.4 for over a year now, yes it's kernel::class or does <5.4 not handle ClassName::class? – Tom Hutchison Jun 13 '17 at 22:10
  • @Fred -ii- please check my edit – Tom Hutchison Jun 13 '17 at 22:11
  • See the duplicate; the [`Unexpected T_CLASS`](https://stackoverflow.com/questions/32205590/laravel-parse-error-syntax-error-unexpected-t-class-expecting-t-string-or-t-v) is listed in it and it does have to do with the versions of php with a second duplicate added. – Funk Forty Niner Jun 13 '17 at 22:14
  • `::class` since 5.5 – ficuscr Jun 13 '17 at 22:15
  • 1
    Okay, found my answer thanks to @ficuscr https://stackoverflow.com/questions/22835370/php-5-4-getting-fully-qualified-class-name-of-an-instance-variable 5.4 handles it with get_class rather than Name::Class – Tom Hutchison Jun 13 '17 at 22:15
  • Thank you guys, it all makes sense, the code must not have been using the kernel request up until today – Tom Hutchison Jun 13 '17 at 22:16

0 Answers0