Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Patch to get Magento 1.9 working with >= PHP 7.0.0 RC 6

Patch using method below or if you don't want to patch a core file, see this Magento extension that does the same thing but correctly overrides the core file:

# run in magento root directory

# one-liner to apply patch using wget
wget -qO- '' | patch -p0

# one-liner to apply patch using curl
curl -s '' | patch -p0

# ...easier to read

# to apply with wget
wget -qO- $PATCH_URL | patch -p0

# ...or with curl
curl -s $PATCH_URL | patch -p0

# to revert using wget  
wget -qO- $PATCH_URL | patch -p0 -R

# ...or revert using curl  
curl -s $PATCH_URL | patch -p0 -R


--- app/code/core/Mage/Core/Model/Layout.php
+++ app/code/core/Mage/Core/Model/Layout.php
@@ -552,7 +552,7 @@
$out = '';
if (!empty($this->_output)) {
foreach ($this->_output as $callback) {
- $out .= $this->getBlock($callback[0])->$callback[1]();
+ $out .= $this->getBlock($callback[0])->{$callback[1]}();

This comment has been minimized.

Copy link

navarr commented Nov 16, 2015

Is there a Magento2 PR for this fix yet?


This comment has been minimized.

Copy link

franciskim commented May 13, 2016

Very cool. And I suppose it works with PHP 7.0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.