Bug #70226 [Nab]: ReflectionType::isBuiltin reports false for builtin classes
| From: | nikic@php.net | Date: | Mon, 10 Aug 2015 12:26:51 +0000 |
| Subject: | Bug #70226 [Nab]: ReflectionType::isBuiltin reports false for builtin classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195084@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70226&edit=1
ID: 70226
Updated by: nikic@php.net
Reported by: tim_siebels_aurich at yahoo dot de
Summary: ReflectionType::isBuiltin reports false for builtin
classes
Status: Not a bug
Type: Bug
Package: Reflection related
Operating System: any
PHP Version: 7.0.0beta3
Block user comment: N
Private report: N
New Comment:
See also https://github.com/php/php-src/pull/1190, which
contains extensive discussion for how this method should be called.
Previous Comments:
------------------------------------------------------------------------
[2015-08-10 12:24:29] nikic@php.net
"Bulitin" refers to a buiting types like array, string etc. It does not tell you whether a
class type refers to an internal class or not. You can use ReflectionClass->isInternal() to
determine that.
------------------------------------------------------------------------
[2015-08-10 12:03:26] tim_siebels_aurich at yahoo dot de
Description:
------------
ReflectionType::isBuiltin checks for the type not being
object.
That way *objects* that are built in, are considered *not* Builtin()
Test script:
---------------
<?php
function foobar(ReflectionMethod $noType)
{
}
$r = new ReflectionFunction('foobar');
var_dump($r->getParameters()[0]->getType()->isBuiltin());
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70226&edit=1