Parse error: syntax error, unexpected '[' in path/TwitterOAuth.php on line 129
public function oauth($path, array $parameters = [])
Guys! What this? Its really fix?
Parse error: syntax error, unexpected '[' in path/TwitterOAuth.php on line 129
public function oauth($path, array $parameters = [])
Guys! What this? Its really fix?
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",
];
?>
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 = [])