Hello Internals!

I'm just on and off luker here but thought I'll throw in an idea for a
feature I'd love to see in PHP: aliasing static methods.

Syntax would look something like this:

  use Namespaced\SomeClass::staticMethod;
  use Some\Foo::bar as fooBar;

  staticMethod(); // would call Namespaced\SomeClass::staticMethod()
  fooBar(); // would call Some\Foo::bar()

This would make code more readable, by removing the the noise of
repetition of class names. For use cases we can look at Java use cases
for "import static".

Aliasing class constants like that would also be very nice.

What does everyone think?
Would it be possible in PHP?

--
Giedrius Dubinskas

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to