What does php -v give you on cli?
Forgetting Laravel for the moment, if you make a script and put the following in it
<?php
class Foo{}
echo Foo::class;
Do you get "Foo" output when ran from cli? php foo.php
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I read around some similar topics about this error:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in C:\wamp\www\laravel5\artisan on line 31
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output:
run-script [--dev] [--no-dev] [-l|--list] [script] [args1] ... [argsN]
But in my case I have latest PHP stable version (5.6.11) and all the requirements are fulfilled (OpenSSL PHP Extension, PDO PHP Extension, Mbstring PHP Extension, Tokenizer PHP Extension - built-in)
Please, any help? Thank you
What does php -v give you on cli?
Forgetting Laravel for the moment, if you make a script and put the following in it
<?php
class Foo{}
echo Foo::class;
Do you get "Foo" output when ran from cli? php foo.php
Please or to participate in this conversation.