Bug #74939 [Asn->Csd]: Nested traits' aliased methods are lowercased
| From: | nikic@php.net | Date: | Tue, 03 Mar 2020 10:57:17 +0000 |
| Subject: | Bug #74939 [Asn->Csd]: Nested traits' aliased methods are lowercased | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225857@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74939&edit=1
ID: 74939
Updated by: nikic@php.net
Reported by: jakub at chabek dot cz
Summary: Nested traits' aliased methods are lowercased
-Status: Assigned
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Irrelevant
PHP Version: Irrelevant
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Fixed by https://github.com/php/php-src/commit/53efa1b0c69b463ea9d3606d828c036129f2dec9.
Previous Comments:
------------------------------------------------------------------------
[2017-07-17 15:06:22] requinix@php.net
The lowercasing is happening in the engine - reflection is working correctly.
Showing all methods: https://3v4l.org/gqENX
T1's method is lowercased while T2's is not.
------------------------------------------------------------------------
[2017-07-17 11:45:28] jakub at chabek dot cz
Description:
------------
Reflection API returns lower case method name when multiple traits are nested.
Test script:
---------------
trait TraitA {
function sameName() {}
}
trait TraitB {
use TraitA {sameName as someOtherName;}
function sameName() {}
}
class SomeClass {
use TraitB {sameName as yetAnotherName;}
function sameName() {}
}
$reflection = new \ReflectionClass(SomeClass::class);
var_dump($reflection->getMethod('someOtherName')->getName());
Expected result:
----------------
string(13) "someOtherName"
Actual result:
--------------
string(13) "someothername"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74939&edit=1