|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patches73195 (last revision 2016-09-28 15:49 UTC by cmb@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-09-28 10:05 UTC] grgtvs at gmail dot com
-Type: Bug
+Type: Documentation Problem
[2016-09-28 10:05 UTC] grgtvs at gmail dot com
[2016-09-28 15:48 UTC] cmb@php.net
-Status: Open
+Status: Analyzed
-Assigned To:
+Assigned To: johannes
[2016-09-28 15:48 UTC] cmb@php.net
[2016-09-28 15:49 UTC] cmb@php.net
[2016-09-28 16:29 UTC] johannes@php.net
-Assigned To: johannes
+Assigned To: cmb
[2016-09-28 16:29 UTC] johannes@php.net
[2016-09-28 16:37 UTC] cmb@php.net
[2016-09-29 09:43 UTC] cmb@php.net
[2016-09-29 10:12 UTC] cmb@php.net
[2016-09-29 10:13 UTC] cmb@php.net
-Status: Analyzed
+Status: Closed
[2016-09-29 10:13 UTC] cmb@php.net
[2020-02-07 06:06 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 14:00:02 2025 UTC |
Description: ------------ It seems that when using filters argument with combinations of the constants ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC, ReflectionMethod::IS_PROTECTED, ReflectionMethod::IS_PRIVATE, ReflectionMethod::IS_ABSTRACT, ReflectionMethod::IS_FINAL - e.g `$reflectionClassObj->getMethod(~ReflectionMethod::IS_PUBLIC)` or `$reflectionClassObj->getMethod(ReflectionMethod::IS_PUBLIC & ~ReflectionMethod::IS_STATIC)` etc. the method tends to return every method as it would do without defining any filters. I've tried this on PHP 5.5.9 as well as at 7.0.8 and the result is the same. Test script: --------------- class MyClass { final public function iamFinalPublic() { } public function iamPublic() { } } function testReflection() { $refl = new ReflectionClass(MyClass::class); $methods = $refl->getMethods(~ReflectionMethod::IS_PUBLIC); return count($methods); } echo testReflection(); Expected result: ---------------- 0 Actual result: -------------- 2