|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-11-26 15:21 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2021-11-26 15:21 UTC] nikic@php.net
[2021-11-26 20:04 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 08:00:01 2025 UTC |
Description: ------------ Prior to PHP 8.1 to invoke private method with ReflectionMethod calling "setAccessible" with "true" was needed. Test script: --------------- <?php class Foo { private function bar() { return 42; } } $foo = new Foo(); $reflection = new \ReflectionMethod($foo, 'bar'); echo $reflection->invoke($foo); Expected result: ---------------- The need of calling "setAccessible": "$reflection->setAccessible(true);".