1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-02 19:32:35 +02:00

Explicitly capture $this for PHP 5.3

This commit is contained in:
Aidan Woods
2018-04-06 20:40:25 +01:00
parent c6b717cc35
commit 0039cd00f8

View File

@@ -1648,10 +1648,13 @@ class Parsedown
protected function elementsApplyRecursive($closure, array $Elements)
{
# PHP 5.3 compat
$instance = $this;
return array_reduce(
$Elements,
function (array $Elements, array $Element) use ($closure) {
$Elements[] = $this->elementApplyRecursive($closure, $Element);
function (array $Elements, array $Element) use ($instance, $closure) {
$Elements[] = $instance->elementApplyRecursive($closure, $Element);
return $Elements;
},
array()