Parse Error: Syntax Error, Unexpected '[', Expecting ')'

PHP Parse error: syntax error, unexpected '[', expecting ';' or ',' in ./dbdrivers/odbc.php IN $$args[1]

You have to specify either

${$args[1]}

or

${$args}[1]

https://www.php.net/manual/en/language.variables.variable.php

What's wrong? PHP Parse error: syntax error, unexpected '}', expecting ',' or ';' in

You missed ;. Each statement must ends up with a semicolon in PHP.

How to fix Parse error: syntax error, unexpected ')', expecting '['?

Name the category variable properly

@forelse ($categories as $category)

Hope this helps

Parse error: syntax error, unexpected '=', expecting ',' or ';'

This should be

<?php
global $url = "/blog-1/index.html"; //no need of global here
if ($_SERVER['HTTP_REFERER'] == $url)
{
header('Location: /blog-2/index.html');
exit();
}
?>

if ($_SERVER['HTTP_REFERER'] == global $url) { here global $url is the culprit

Fatal error - Parse error: syntax error, unexpected ':', expecting - Wordpress

The version of ACF you're using requires PHP 7.0+. The error message you're getting indicates you're using PHP 5.6 or older. You should talk to your hosting provider about allowing you to upgrade to newer version of PHP.

This error specifically is caused by a new PHP method declaration syntax introduced in PHP 7.0 that allows you to declare that the method you're defining will return an array, which you can read about here: http://php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration

If your hosting provider won't upgrade your PHP version, I suggest you find a new hosting provider. But if you need ACF to work in the meantime, you can go to the advanced page for ACF in the repository and download an older version at the bottom of the page.

Note: Both of these practices (using an outdated PHP version and using an outdate plugin) can be detrimental to the long-term health of your WordPress installation. I'd recommend getting on to PHP 7.2 at least as soon as you're able, which will allow you to use the most recent version of ACF.



Related Topics



Leave a reply



Submit