Re: Trait behavior when providing a new name while no conflict exists
| From: | Stefan Marr | Date: | Thu, 18 Nov 2010 18:00:51 +0000 |
| Subject: | Re: Trait behavior when providing a new name while no conflict exists | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50366@lists.php.net to get a copy of this message | ||
Hi Patrick:
On 18 Nov 2010, at 16:01, Patrick ALLAERT wrote:
> Hi,
>
> Is this intended not being able to give a new name to a method even in
> case of no conflict?
> In the following example, I try to provide the name "sayIt"
> additionally to "saySomething" from trait "Hello":
>
> <?php
> trait Hello {
> public function saySomething() {
> echo 'Hello';
> }
> }
>
> class MyHello{
> use Hello {
> Hello::saySomething as sayIt;
> }
> }
> ?>
Thanks for catching this, it is a bug.
It works without the Hello:: part and it should also work with the Hello::.
Fixed with the following commit: http://svn.php.net/viewvc?view=revision&revision=305512
Best regards
Stefan
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: +32 2 629 3525