|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-11 18:15 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: gron
[2011-07-11 18:38 UTC] gron@php.net
-Status: Assigned
+Status: Closed
-Type: Bug
+Type: Feature/Change Request
[2011-07-11 18:38 UTC] gron@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 15:00:01 2025 UTC |
Description: ------------ I have 2 traits with the same method name. I don't want to keep one and rename (alias) the other, but rename both. use X, Y { X::set as setX; Y::set as setY; } Test script: --------------- <?php trait X { protected $_x = 0; public function set($x) { $this->_x = $x; } } trait Y { protected $_y = 0; public function set($y) { $this->_y = $y; } } class MyClass { use X, Y { X::set as setX; Y::set as setY; } } ?> Expected result: ---------------- MyClass with 2 method and 2 properties : class MyClass { protected $_x = 0; protected $_y = 0; public function setX($x) { $this->_x = $x; } public function setY($y) { $this->_y = $y; } } Actual result: -------------- PHP Fatal error: Trait method set has not been applied, because there are collisions with other trait methods on MyClass