On 7 February 2018 at 15:20, Christoph M. Becker <cmbecke...@gmx.de> wrote:

> On 07.02.2018 at 15:02, Rowan Collins wrote:
>
> > - PHP 7.3: Add syntax to explicitly reference functions and constants in
> > the current namespace, such as .\foo or this\foo
>
> It is already possible to use the `namespace` keyword for this, see
> <https://3v4l.org/bikjE>.
>


Huh, I never knew that! Funnily enough, I thought of that as a possibility
(because it's already a reserved word) but rejected it as too long. :P



> > - Slightly uglier syntax.
>
> IMHO, .\foo is very ugly, and namespace\foo is not much better.
>


Yeah; the question is whether that ugliness is something we're willing to
live with for the performance and features it would enable. Most code would
still be less ugly than if we had to prefix all global functions, anyway.

Something worth considering is that even when using namespaced functions,
the shorthand is only available in *exactly the current namespace*, so
you're rather likely to be qualifying or importing them anyway. For
instance, they might be in a child or neighbouring namespace called
"...\functions" or " ...\ utils" or " ...\ streams".

Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to