Nope, it's only available in 5.5 and above
Oct 29, 2014
7
Level 10
Using ::class not working with php 5.4.4?
I use the ::class property (is that what this is called in php lingo?) in various places in my code to resolve the fully namespaced path easier (such as in relations).
Everything works fine on my localhost (using homestead), but when i deploy to a remote server (php 5.4.4 on it), I'm getting this error:
syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'
Here's the snippet of code that's causing the issue:
$repo = App::make(UserRepository::class);
Does anyone have any idea why this wouldn't be working? It's my understanding that ::class should work in php5.4+?
Level 13
1 like
Please or to participate in this conversation.