Magento 1.9 issue on PHP7 hot fix

Recently, PHP7 release with a lot of performance feature improvements. But the problem is when you use magento 1.9 for PHP7 will turn out some problems in core. Since this issue is still not updated to new version of magento 1.9, I will show you here a quick hot fix to make it work.

magento 1.9 and php7

It ‘s quite simple to fix this issue. Let’s find this file:

File: app/code/core/Mage/Core/Model/Layout.php

Inside function getOutput(), change this line:

[code lang=”php”]$out .= $this->getBlock($callback[0])->$callback[1]();[/code]

If you’re interested to learn more about why this happens, read about the new Uniform Variable Syntax.

Update Nikita Popov suggested that you can even do this in 1 line like so: