Closed bakura10 closed 10 years ago
And how would the lazy instantiation work in that case?
You're right, my approach is wrong.
Other optimizations (didn't try them, you should test):
Indeed, that would work.must be in the other order through to work:
$routeMatch->getParams() + $this->params
Ok so this should be a bit faster then :).
Good use case for generators :heart_eyes: ZF3 will be 5.4 or 5.5?
5.4…
Which reminds me, we are using the new merging now – can be closed.
Here: https://github.com/DASPRiD/Dash/blob/master/src/Dash/Router/Http/RouteCollection/RouteCollection.php#L102
Implementing IteratorAggregate is much faster than implementing any iterator interface (because PHP needs to call around 5 custom functions at each iteration).
I'm wondering if you cannot implement IteratorAggregate, and do this in RouteCollection: