Bug #80097 [NEW]: ReflectionAttribute is not a Reflector

From: Date: Sat, 12 Sep 2020 15:06:14 +0000
Subject: Bug #80097 [NEW]: ReflectionAttribute is not a Reflector
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228989@lists.php.net to get a copy of this message
From: me at derrabus dot de Operating system: any PHP version: 8.0.0beta3 Package: Reflection related Bug Type: Bug Bug description:ReflectionAttribute is not a Reflector Description: ------------ The new ReflectionAttribute class does not implement the Reflector interface. This is not really a big problem, but feels inconsistent and somewhat unintended. Test script: --------------- <?php $classes = [ 'ReflectionClass', 'ReflectionClassConstant', 'ReflectionZendExtension', 'ReflectionExtension', 'ReflectionFunction', 'ReflectionFunctionAbstract', 'ReflectionMethod', 'ReflectionNamedType', 'ReflectionObject', 'ReflectionParameter', 'ReflectionProperty', 'ReflectionType', 'ReflectionAttribute', ]; foreach ($classes as $class) { $isReflector = class_implements($class, 'Reflector') ? 'yes' : 'no'; $class = str_pad($class, 30); echo "$class$isReflector\n"; } Expected result: ---------------- ReflectionClass yes ReflectionClassConstant yes ReflectionZendExtension yes ReflectionExtension yes ReflectionFunction yes ReflectionFunctionAbstract yes ReflectionMethod yes ReflectionNamedType yes ReflectionObject yes ReflectionParameter yes ReflectionProperty yes ReflectionType yes ReflectionAttribute yes Actual result: -------------- ReflectionClass yes ReflectionClassConstant yes ReflectionZendExtension yes ReflectionExtension yes ReflectionFunction yes ReflectionFunctionAbstract yes ReflectionMethod yes ReflectionNamedType yes ReflectionObject yes ReflectionParameter yes ReflectionProperty yes ReflectionType yes ReflectionAttribute no -- Edit bug report at https://bugs.php.net/bug.php?id=80097&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80097&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80097&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80097&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80097&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80097&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80097&r=support Expected behavior: https://bugs.php.net/fix.php?id=80097&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80097&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80097&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80097&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80097&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80097&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80097&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80097&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80097&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80097&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80097&r=mysqlcfg

« previous php.bugs (#228989) next »