diff --git a/src/JWadhams/JsonLogic.php b/src/JWadhams/JsonLogic.php index 8e0227d..16a3421 100644 --- a/src/JWadhams/JsonLogic.php +++ b/src/JWadhams/JsonLogic.php @@ -50,9 +50,11 @@ public static function apply($logic = [], $data = []) if (! self::is_logic($logic)) { if (is_array($logic)) { //Could be an array of logic statements. Only one way to find out. - return array_map(function ($l) use ($data) { - return self::apply($l, $data); - }, $logic); + $values = []; + foreach ($logic as $key => $value) { + $values[$key] = self::apply($value, $data); + } + return $values; } else { return $logic; }