Re: [RFC] Importing namespaced functions

From: Date: Tue, 23 Jul 2013 08:10:47 +0000
Subject: Re: [RFC] Importing namespaced functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 19.07.2013, at 21:29, Igor Wiedler <[email protected]> wrote:
>
> > Hello internals,
> >
> > I posted the initial idea for a use_function RFC a few months back. I
> would like to make the proposal official now, and open it for discussion.
> >
> > I also did some work on a patch that probably still has some issues.
> Review on that is welcome as well.
> >
> > RFC: https://wiki.php.net/rfc/use_function
> > Patch: https://github.com/php/php-src/pull/388
>
>
 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


Thread (37 messages)

« previous php.internals (#68282) next »