PHP :: Bug #65419 :: Inside trait, self::class != __CLASS__
| Bug #65419 | Inside trait, self::class != __CLASS__ | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2013-08-08 08:44 UTC | Modified: | 2014-11-28 13:22 UTC |
|
||||||
| From: | nicolas dot grekas+php at gmail dot com | Assigned: | ralphschindler (profile) | |||||||
| Status: | Closed | Package: | Scripting Engine problem | |||||||
| PHP Version: | 5.5.1 | OS: | ||||||||
| Private report: | No | CVE-ID: | None | |||||||
[2013-08-08 08:44 UTC] nicolas dot grekas+php at gmail dot com
Description: ------------ The RFC for ::class name resolution as scalar say that self::class resolves the same as __CLASS__: https://wiki.php.net/rfc/class_name_scalars#considerations But this is not true when using traits. Test script: --------------- <?php trait abc { static function def() { echo self::class, "\n"; echo __CLASS__, "\n"; } class ghi { use abc; } ghi::def(); Expected result: ---------------- ghi ghi Actual result: -------------- abc ghi
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2013-08-08 18:33 UTC] requinix@php.net
[2013-08-09 07:55 UTC] nicolas dot grekas+php at gmail dot com
[2013-08-09 07:57 UTC] gron@php.net
-Status: Open +Status: Verified
[2013-08-09 07:57 UTC] gron@php.net
[2013-08-11 15:31 UTC] laruence@php.net
[2013-08-14 10:10 UTC] nicolas dot grekas+php at gmail dot com
[2013-09-12 16:52 UTC] ralphschindler@php.net
[2014-02-18 08:34 UTC] nicolas dot grekas+php at gmail dot com
[2014-11-28 12:38 UTC] jpauli@php.net
-Status: Verified +Status: Closed
[2014-11-28 13:22 UTC] jpauli@php.net
-Status: Closed +Status: Feedback
[2014-12-05 07:00 UTC] ab@php.net
-Status: Feedback +Status: Closed