php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72917 Regression in behavior of strval(ReflectionType) + possibly others?
Submitted: 2016-08-22 03:11 UTC Modified: 2016-08-22 05:02 UTC
From: ezzatron at gmail dot com Assigned:
Status: Duplicate Package: Reflection related
PHP Version: 7.1.0beta3 OS: N/A
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ezzatron at gmail dot com
New email:
PHP Version: OS:

 

 [2016-08-22 03:11 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-22 05:02 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2016-08-22 05:02 UTC] requinix@php.net
Duplicate of bug #72906
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC