-
For an one-time logic to data use case, the
applyfunction is enough:echo \JsonLogic\JsonLogic::apply($rule, $data);
-
For a rule runs tons times, e.g. find matched records in daily logs:
$rule = \JsonLogic\JsonLogic::rule($rule); var_dump( array_filter($logs, function ($log) use ($rule) { return $rule->process($log); }) );