From: Operating system: Irrelevant PHP version: trunk-SVN-2011-02-01 (SVN) Package: Scripting Engine problem Bug Type: Bug Bug description:Reflection API shows wrong class name for namespaced type hints
Description: ------------ When using namespaced classes as a type hint like in the test script attached to this bug report, the ReflectionParameter object generated for the parameter contains a fully-qualified class name for the type hinted class where the name of the namespace is duplicated (see actual output). This also causes ReflectionParameter::getClass() to fail as no ReflectionClass object can be created for the invalid class name. Test script: --------------- <?php namespace ImageTransform; interface FileAccessAdapter { public function create(ImageTransform\Image $image, $width, $height); } $method = new \ReflectionMethod('ImageTransform\FileAccessAdapter', 'create'); foreach ($method->getParameters() as $parameter) { print $parameter; } ?> Expected result: ---------------- Parameter #0 [ <required> ImageTransform\Image $image ]Parameter #1 [ <required> $width ]Parameter #2 [ <required> $height ] Actual result: -------------- Parameter #0 [ <required> ImageTransform\ImageTransform\Image $image ]Parameter #1 [ <required> $width ]Parameter #2 [ <required> $height ] -- Edit bug report at http://bugs.php.net/bug.php?id=53900&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53900&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53900&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53900&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53900&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53900&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53900&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53900&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53900&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53900&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53900&r=support Expected behavior: http://bugs.php.net/fix.php?id=53900&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53900&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53900&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53900&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53900&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53900&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53900&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53900&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53900&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53900&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53900&r=mysqlcfg