Bug #72917 [Opn->Dup]: Regression in behavior of strval(ReflectionType) + possibly others?

From: Date: Mon, 22 Aug 2016 05:02:48 +0000
Subject: Bug #72917 [Opn->Dup]: Regression in behavior of strval(ReflectionType) + possibly others?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203469@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72917&edit=1

 ID:                 72917
 Updated by:         requinix@php.net
 Reported by:        ezzatron at gmail dot com
 Summary:            Regression in behavior of strval(ReflectionType) +
                     possibly others?
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Reflection related
 Operating System:   N/A
 PHP Version:        7.1.0beta3
 Block user comment: N
 Private report:     N

 New Comment:

Duplicate of bug #72906


Previous Comments:
------------------------------------------------------------------------
[2016-08-22 03:11:27] ezzatron at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=72917&edit=1


Thread (2 messages)

« previous php.bugs (#203469) next »