php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74434 private methods from super classes' traits are listed in reflectionclass
Submitted: 2017-04-13 15:05 UTC Modified: 2017-04-13 18:18 UTC
From: nontelado at example dot org Assigned:
Status: Not a bug Package: Reflection related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nontelado at example dot org
New email:
PHP Version: OS:

 

 [2017-04-13 15:05 UTC] nontelado at example dot org
Description:
------------
https://3v4l.org/sSUph

Test script:
---------------
trait TTT{
    private function baz(){}
}

class AAA{
    use TTT;
}

class BBB extends AAA{}

$RC = new ReflectionClass(BBB::CLASS);
var_dump($RC->getMethods(ReflectionMethod::IS_PRIVATE));
// lists TTT::baz


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-13 18:18 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2017-04-13 18:18 UTC] requinix@php.net
Reflection will show inaccessible members. That's the nature of reflection.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Jun 04 21:01:23 2020 UTC