mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #605 from aidantwoods/fix/this-php5.3-compat
Explicitly capture $this for PHP 5.3
This commit is contained in:
commit
48b9f71bdc
@ -1648,10 +1648,13 @@ class Parsedown
|
|||||||
|
|
||||||
protected function elementsApplyRecursive($closure, array $Elements)
|
protected function elementsApplyRecursive($closure, array $Elements)
|
||||||
{
|
{
|
||||||
|
# PHP 5.3 compat
|
||||||
|
$instance = $this;
|
||||||
|
|
||||||
return array_reduce(
|
return array_reduce(
|
||||||
$Elements,
|
$Elements,
|
||||||
function (array $Elements, array $Element) use ($closure) {
|
function (array $Elements, array $Element) use ($instance, $closure) {
|
||||||
$Elements[] = $this->elementApplyRecursive($closure, $Element);
|
$Elements[] = $instance->elementApplyRecursive($closure, $Element);
|
||||||
return $Elements;
|
return $Elements;
|
||||||
},
|
},
|
||||||
array()
|
array()
|
||||||
|
Loading…
Reference in New Issue
Block a user