Syntax Error
miikee-us opened this issue · comments
I'm getting this error after installing and trying to access the Adauth controller.
`Parse error: syntax error, unexpected '?' in C:\inetpub\wwwapex\application\controllers\Adauth.php on line 841
A PHP Error was encountered
Severity: Parsing Error
Message: syntax error, unexpected '?'
Filename: controllers/Adauth.php
Line Number: 841
Backtrace:`
Are you using PHP 5.x by any chance?
Line 841: $defaultCompany = $_POST['company'] ?? $this->config->item('default_company', 'adauth');
I'm using the null coalescing operator that was introduced in PHP7.
You can replace it in your code with the below:
if (isset($_POST['company']))
{
$defaultCompany = $_POST['company'];
}
else
{
$defaultCompany = $this->config->item('default_company', 'adauth');
}
Yes, I was using PHP 5.7. Closing issue.