I am trying to add data on google calendar by PHP. Parse error: syntax error, unexpected '[' google-api-php-client-2.0.1-PHP5_4/vendor/react/promise/src/functions.php on line 15
Asked
Active
Viewed 972 times
1 Answers
1
Line 15 of promise/src/functions.php
in React is an array initialisation using the short [...]
syntax.
$canceller = [$promiseOrValue, 'cancel'];
This syntax is only valid in PHP 5.4 or higher.
I therefore summise you are running PHP 5.3 or earlier. You should upgrade. 5.3 is 7 years old and security support ended in 2014. In addition a lot of the new features will make your coding experience more pleasant and PHP 7.0 is considerably faster.

Matt Raines
- 4,149
- 8
- 31
- 34