0

Parse error: syntax error, unexpected '[' in path/TwitterOAuth.php on line 129

public function oauth($path, array $parameters = [])

Guys! What this? Its really fix?

2 Answers2

1

You are using a PHP version that is way too old for anything, these days.

Defining arrays with [] is only supported from PHP 5.4 as mentioned on this page:

As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].

<?php
$array = array(
    "foo" => "bar",
    "bar" => "foo",
);

// as of PHP 5.4
$array = [
    "foo" => "bar",
    "bar" => "foo",
];
?>
Andrius
  • 5,934
  • 20
  • 28
0

If none of the above answers not working check whether the function resides in any of the classes. Otherwise remove the access specifier public from function definition.

function oauth($path, array $parameters = [])
Sanjay Kumar N S
  • 4,653
  • 4
  • 23
  • 38