From 0039cd00f8bed5bf2794353d29f4ff35bf914cf7 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Fri, 6 Apr 2018 20:40:25 +0100 Subject: [PATCH] Explicitly capture $this for PHP 5.3 --- Parsedown.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index fca5512..bec8e03 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -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()