|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-12-24 15:18 UTC] gron@php.net
[2011-12-24 15:18 UTC] gron@php.net
-Status: Open
+Status: Bogus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ The method ReflectionMethod::setAccessible doesn't change the accessibility of a private method defined in a trait. Test script: --------------- <?php trait Foo { private function foo() {} } class Bar { use Foo; } $bar = new Bar(); $method = new ReflectionMethod('Bar', 'foo'); $method->setAccessible(true); $bar->foo(); Expected result: ---------------- The method foo should be callable. Actual result: -------------- PHP Fatal error: Call to private method Bar::foo() from context '' in ...