Bug #72917 [NEW]: Regression in behavior of strval(ReflectionType) + possibly others?
From: ezzatron at gmail dot com
Operating system: N/A
PHP version: 7.1.0beta3
Package: Reflection related
Bug Type: Bug
Bug description:Regression in behavior of strval(ReflectionType) + possibly others?
Description:
------------
When getting the string value of a ReflectionType instance that
represents a class name, 7.1.0beta3 seems to prefix the value with a
namespace separator.
This behavior is inconsistent with the treatment of runtime class names
across all other PHP functions, such as get_class(), that do not use a
namespace separator prefix.
It is also a regression. 7.1.0_beta1 did not exhibit this issue (not
sure about beta 2).
Test script:
---------------
<?php
$f = function (stdClass $a) {};
$r = new ReflectionFunction($f);
$p = $r->getParameters();
$t = $p[0]->getType();
echo $t;
Expected result:
----------------
stdClass
Actual result:
--------------
\stdClass
--
Edit bug report at https://bugs.php.net/bug.php?id=72917&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72917&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72917&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72917&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72917&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72917&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72917&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72917&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72917&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72917&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72917&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72917&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72917&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72917&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72917&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72917&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72917&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72917&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72917&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72917&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72917&r=mysqlcfg
Thread (2 messages)
- ezzatron at gmail dot com