On 24 November 2017 07:05:52 GMT+00:00, "Khawer ." <khaweronl...@gmail.com> 
wrote:
>We use 'use' keyword to import other namespaces, namespace classes,
>namespace functions, and namespace constants.
>
>Example
>1) use abc; (Import abc namespace)
>2) use abc\ClassB; (Import ClassB  from abc namespace)

Although these are described in the manual as separate types of import, they 
are actually the same: they alias a prefix used to rewrite class names when you 
mention them.

If you have a class "One\Two\Test" and a class "One\Two", then "use One\Two" 
will allow you to access them as "Two\Test" and "Two", respectively. 
https://3v4l.org/nQ7pB

Similarly, if you alias a prefix with "use Foo as Bar", then "new Bar\Test" 
will refer to class "Foo\Test", and "new Bar" will refer to class "Foo". 
https://3v4l.org/2r6WN

So "use class" wouldn't make sense, because that's not actually what happens.

Regards,

-- 
Rowan Collins
[IMSoP]

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

Reply via email to