src/ContextCollection.php
public function find($re, $filter = null) {
        $result = null;
        $this->each(function($context) use ($re, $filter, &$result) {
            $r = $context->find($re, $filter);
            if (!$r->isEmpty()) {
                $result = $r;
                return false;
            }
        });

        return $result?:Context::getEmptyContext();
    }
public function find($re, $filter = null) {
        $result = null;
        $this->each(function($context) use ($re, $filter, &$result) {
            $r = $context->find($re, $filter);
            if (!$r->isEmpty()) {
                $result = $r;
                return false;
            }
        });

        return $result?:Context::getEmptyContext();
    }
public function find ( $ re , $ filter = null ) { $ result = null ; $ this -> each ( function ( $ context ) use ( $ re , $ filter , & $ result ) { $ r = $ context -> find ( $ re , $ filter ) ; if ( ! $ r -> isEmpty ( ) ) { $ result = $ r ; return false ; } } ) ; return $ result ? : Context :: getEmptyContext ( ) ; }
Find the first matching context in the collection
@param  string $re
@param  callable $filter
@return Context
Find the first matching context in the collection