From 387ef63888dd957e01f4362221cfc3552ff87f9c Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Fri, 6 Apr 2018 20:55:27 +0100 Subject: [PATCH] Replace array reduce with foreach loop for PHP 5.3 compat --- Parsedown.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index fca5512..9dde3f4 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -1648,14 +1648,14 @@ class Parsedown protected function elementsApplyRecursive($closure, array $Elements) { - return array_reduce( - $Elements, - function (array $Elements, array $Element) use ($closure) { - $Elements[] = $this->elementApplyRecursive($closure, $Element); - return $Elements; - }, - array() - ); + $newElements = array(); + + foreach ($Elements as $Element) + { + $newElements[] = $this->elementApplyRecursive($closure, $Element); + } + + return $newElements; } protected function element(array $Element)