/** Creates new Matcher that executes $this matcher and if nothing is found * (results is null or empty array), executes second matcher. */ function orElse($m) { $self = $this->f; return new Matcher(function ($node, $context = null) use($self, $m) { $context = Matcher::inventContext($context); return $self($node, $context) ?: Matcher::_evalPath($node, $m, $context); }); }