router icon indicating copy to clipboard operation
router copied to clipboard

Update Router.php

Open svanlaere opened this issue 2 years ago • 4 comments

Aliasing global functions

svanlaere avatar Aug 10 '21 20:08 svanlaere

Why should this be implemented? Any special use or something? 🤔

uvulpos avatar Aug 11 '21 05:08 uvulpos

It has to do with performance — https://www.bram.us/2020/04/18/php-performance-tip-use-fully-qualified-function-calls-when-working-with-namespaces/

bramus avatar Aug 11 '21 08:08 bramus

bramus is right, though I do believe its should be like this to become a fully qualified name? use function Bramus\Router\array_keys;

Its also convenient for developers that appreciate a quick overview of used functions.

svanlaere avatar Aug 11 '21 09:08 svanlaere

Mh. I actually never thought about this, but it makes perfectly sense. Thanks 👍

LGTM this PR

uvulpos avatar Aug 11 '21 13:08 uvulpos