1

I am using twitterauth.php for getting twitter data in codeigniter php. It gives me error

Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\twitter\application\controllers\twitteroauth.php on line 117

Line 117 is

public function oauth($path, array $parameters = [])
  • 1
    @Volkerk This question seems about right , no body going to read that encyclopedia to get over one minor problem. It is not duplicate as it serve the purpose of site. – anwerj Nov 01 '15 at 12:54
  • 1
    I disagree. a) There's even a option "offtic: parse error" in the voting-for-close system and b) Just search for `unexpected [` in "PHP Parse/Syntax Errors; and How to solve them?" and you get [the exact same answer](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them/29505827#29505827) as the accepted one here, except better. – VolkerK Nov 01 '15 at 13:05

1 Answers1

2

You need PHP 5.4 or over to use square brackets as array. Upgrade PHP or use array().

anwerj
  • 2,386
  • 2
  • 17
  • 36