php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80151 ReflectionType::__toString() hasn't thrown E_DEPRECATED
Submitted: 2020-09-25 21:43 UTC Modified: 2020-09-25 22:15 UTC
From: zeriyoshi at gmail dot com Assigned: nikic (profile)
Status: Closed Package: Reflection related
PHP Version: 8.0.0beta4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zeriyoshi at gmail dot com
New email:
PHP Version: OS:

 

 [2020-09-25 21:43 UTC] zeriyoshi at gmail dot com
Description:
------------
ReflectionType::__toString() deprecated in PHP 7.1.0, however PHP 8.0.0beta4 has'nt thrown E_DEPRECATED.
This is probably a side effect of Stringable implementation.

Test script:
---------------
<?php
error_reporting(E_ALL);
function foo(string $bar){};
echo (new ReflectionFunction("foo"))->getParameters()[0]->getType();

Expected result:
----------------
Deprecated: Function ReflectionType::__toString() is deprecated in Command line code on line %n
string

Actual result:
--------------
string

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-25 22:08 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-09-25 22:08 UTC] nikic@php.net
ReflectionType::__toString() is no longer deprecated in PHP 8.0, cf. https://github.com/php/php-src/blob/e42abeafeca245950ebc47c7312913e68262d40e/UPGRADING#L469-L472
 [2020-09-25 22:15 UTC] zeriyoshi at gmail dot com
ouch. I didn't check it. sorry.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 07:01:33 2025 UTC