I am working on a PHP project and doing the development on Windows and everything works perfectly fine.
When I install the code onto a Linux box the page breaks and I get the following error:
PHP Fatal error: Can't use function return value in write context
The line that this error is referring to is
if (!isset(parent::getPostArray()["searchRefOnly"]))
And all the parent::getPostarray()
function does is return an array as follows:
protected function getPostArray()
{
return $this->postArray;
}
The above code works perfectly fine on Windows, so why not on Linux?