note 125211 added to reflectiontype.tostring
| From: | Anonymous@php.net | Date: | Sun, 26 Jul 2020 16:32:58 +0000 |
| Subject: | note 125211 added to reflectiontype.tostring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214895@lists.php.net to get a copy of this message | ||
Regarding this method's deprecation:
ReflectionType::__toString() was first deprecated in PHP 7.1.0 alpha1.
The deprecation notice was removed in PHP 7.1.0 RC3, before being reinstated in PHP 7.4.0 alpha1.
Starting with PHP 7.1.0 beta 3, ReflectionParameter::getType() &
ReflectionFunctionAbstract::getReturnType() return instances of ReflectionNamedType instead of
ReflectionType.
The ReflectionNamedType class inherits from ReflectionType but provides an additional getName()
method which can be used to retrieve the type hint.
Lastly, PHP 8.0.0 alpha1 introduced the concept of union types (see https://wiki.php.net/rfc/union_types_v2). As a
result, ReflectionParameter::getType() & ReflectionFunctionAbstract::getReturnType() will now
return either instances of ReflectionNamedType or ReflectionUnionType depending on the type hint,
both of which are descendants of ReflectionType.
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 79.81.208.170)
----
Manual Page -- http://php.net/manual/en/reflectiontype.tostring.php
Edit -- https://master.php.net/note/edit/125211
Del: integrated -- https://master.php.net/note/delete/125211/integrated
Del: useless -- https://master.php.net/note/delete/125211/useless
Del: bad code -- https://master.php.net/note/delete/125211/bad+code
Del: spam -- https://master.php.net/note/delete/125211/spam
Del: non-english -- https://master.php.net/note/delete/125211/non-english
Del: in docs -- https://master.php.net/note/delete/125211/in+docs
Del: other reasons-- https://master.php.net/note/delete/125211
Reject -- https://master.php.net/note/reject/125211
Search -- https://master.php.net/manage/user-notes.php