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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC