Doc #80247 [Opn->Csd]: ReflectionType does not have an isBuiltin() method
| From: | phpdocbot@php.net | Date: | Sun, 27 Dec 2020 23:24:15 +0000 |
| Subject: | Doc #80247 [Opn->Csd]: ReflectionType does not have an isBuiltin() method | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18324@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80247&edit=1
ID: 80247
Updated by: phpdocbot@php.net
Reported by: info at chrisdoehring dot de
Summary: ReflectionType does not have an isBuiltin() method
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Reflection related
Operating System: Linux
PHP Version: 8.0.0RC2
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=c40f07c937efd99aa9ffcba126977e7536d1c2fd
Log: Fix #80247: ReflectionType does not have an isBuiltin() method
Previous Comments:
------------------------------------------------------------------------
[2020-12-27 23:23:04] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=352224
Log: Fix #80247: ReflectionType does not have an isBuiltin() method
Closes GH-273.
------------------------------------------------------------------------
[2020-10-16 15:53:58] nikic@php.net
In PHP 8, ReflectionType does not have an isBuiltin() method.
I recommend documenting this by removing ReflectionType::isBuiltin() from the docs completely
(leaving only ReflectionNamedType::isBuiltin()). The fact that this method used to exist on earlier
PHP versions is not useful, as ReflectionNamedType was the only ReflectionType there anyway.
------------------------------------------------------------------------
[2020-10-16 15:44:19] info at chrisdoehring dot de
Description:
------------
The in php 8 added "ReflectionUnionType" class should extend the ReflectionType class
according to the RFC proposal (https://wiki.php.net/rfc/union_types_v2#reflection), but the
inherited "isBuiltin" method (https://www.php.net/manual/de/reflectiontype.isbuiltin.php)
does not exist.
Example script: https://3v4l.org/5BDRn
How it looks like without union type: https://3v4l.org/TGkX2
Test script:
---------------
<?php
class SomeClass
{
protected string|stdClass $a;
}
$unionType = (new \ReflectionClass(SomeClass::class))->getProperty('a')->getType();
var_dump($unionType->isBuiltin());
Expected result:
----------------
bool(false)
Actual result:
--------------
Fatal error: Uncaught Error: Call to undefined method ReflectionUnionType::isBuiltin() in
/in/5BDRn:8
Stack trace:
#0 {main}
thrown in /in/5BDRn on line 8
Process exited with code 255.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80247&edit=1