x-fran / g-trends

Google Trends API for PHP
https://tarlabs.es
MIT License
112 stars 47 forks source link

Parse error: syntax error, unexpected '?' in g-trends-master/src/Google/GTrends.php on line 147 #27

Closed Sukhpall-Singh closed 4 years ago

Sukhpall-Singh commented 4 years ago

I am trying to integrate this on my site but I am facing above problem when i am implementing on server. I tested it on local system and its working fine but I dont know why it is not working on server. Here is the line in GTrends.php where it is showing error:

$kWord = $widget['request']['restriction']['complexKeywordsRestriction']['keyword'][0]['value'] ?? null;

Is there any php version problem? because in my local system I have installed php version 7.1.2 but on server its 5.6.2? Thanks!

x-fran commented 4 years ago

The recommended PHP version is 7 and up.