Bug #63399 [NEW]: ReflectionClass::getTraitAliases() incorrectly resolves traitnames
| From: | r dot wilczek at web-appz dot de | Date: | Tue, 30 Oct 2012 14:19:43 +0000 |
| Subject: | Bug #63399 [NEW]: ReflectionClass::getTraitAliases() incorrectly resolves traitnames | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-174423@lists.php.net to get a copy of this message | ||
From: r dot wilczek at web-appz dot de
Operating system: Linux x86_64
PHP version: 5.4.7RC1
Package: Reflection related
Bug Type: Bug
Bug description:ReflectionClass::getTraitAliases() incorrectly resolves traitnames
Description:
------------
When aliasing an importing traitmethod without explicitely declaring the
trait's name, ReflectionClass::getTraitAliases() renders the traitname as
'(null)'.
The method should render the correct traitname, as if the aliasing had been
done using the full qualifier.
(Actually, my PHP-version is 5.4.7, not 5.4.7RC1)
Test script:
---------------
trait MyTrait
{
public function run() {}
}
class MyClass
{
use MyTrait {
run as execute;
}
}
var_export((new \ReflectionClass('MyClass'))->getTraitAliases());
Expected result:
----------------
array (
'execute' => 'MyTrait::run',
)
Actual result:
--------------
array (
'execute' => '(null)::run',
)
--
Edit bug report at https://bugs.php.net/bug.php?id=63399&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63399&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63399&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63399&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63399&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63399&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63399&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63399&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63399&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63399&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63399&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63399&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63399&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63399&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63399&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63399&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63399&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63399&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63399&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63399&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63399&r=mysqlcfg