Aaron Piotrowski wrote on 22/04/2016 15:56:
While this is somewhat off-topic of this particular RFC, since we can already
do general type-aliasing with `use`,
use SomeFoo as Foo;
perhaps similar syntax could be used for type expressions, eliminating the need
for a new keyword.
use callable(int, int): int as IntReducer;
use array | Traversable as Iterable;
The problem with that is that you might want to export (and then import)
a type definition:
namespace MyPackage\Types {
type Foo as \Symfony\Bar | \Zend\FooBar;
}
namespace Other {
use \MyPackage\Types\Foo as FooType;
}
That would become terrible confusing if you overloaded the "use" keyword.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php