You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both of these approaches provide the same performance benefit:
Inside a namespace, when PHP encounters an unqualified Name in a class name, function or constant context, it resolves these with different priorities. Class names always resolve to the current namespace name. Thus to access internal or non-namespaced user classes, one must refer to them with their fully qualified Name.
...
For functions and constants, PHP will fall back to global functions or constants if a namespaced function or constant does not exist.
The question is whether we should continue using inline \s or if we should instead switch to use statements.
Personally, I prefer the inline \s as I feel it's easier to remember to include those versus maintaining the list of use statements at the top of the file (or needing to always run phpcbf after making changes). But I'm open to other opinions here.
The text was updated successfully, but these errors were encountered:
Currently this standard requires that all references to things in the global namespace be prefixed with a
\
wherever they are used:Alternatively, we could remove the
\
s and requireuse
statements for all of these:Both of these approaches provide the same performance benefit:
The question is whether we should continue using inline
\
s or if we should instead switch touse
statements.Personally, I prefer the inline
\
s as I feel it's easier to remember to include those versus maintaining the list ofuse
statements at the top of the file (or needing to always run phpcbf after making changes). But I'm open to other opinions here.The text was updated successfully, but these errors were encountered: