If you encounter this problem when trying to run laravel new [appname], please run composer global update first.
More info here – https://stackoverflow.com/questions/44100316/laravel-cli-fails-to-create-new-app-due-to-cannot-use-lexical-variable-eventnam