Re: [RFC] Importing namespaced functions
| From: | Igor Wiedler | Date: | Tue, 23 Jul 2013 10:44:24 +0000 |
| Subject: | Re: [RFC] Importing namespaced functions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68284@lists.php.net to get a copy of this message | ||
Hi Martin,
Aliasing is possible, there is an example of it in the test cases of the patch [0].
As for your example, it's valid.
Regards,
Igor
[0]: https://github.com/igorw/php-src/blob/use-function/Zend/tests/use_function/alias.phpt
On Jul 23, 2013, at 10:10 AM, Martin Keckeis <martin.keckeis1@gmail.com> wrote:
> Hello,
>
> some questions:
> Alias is not required, but is it possible?
>
> Would it be possible to write something like this?
> <?php
> namespace MySpace;
>
> use OtherLib\HtmlResponse;
> use function html\div, html\p, html\em;
>
> class MyClass{
>
> public function getResponse(){
> return new HtmlResponse( div(p('Some', em('Text'))) );
> }
> }
> ?>
>
> Best regards
> Martin