Bug #72305 [Ana]: ReflectionParameter::isCallable is not implemented properly
Edit report at https://bugs.php.net/bug.php?id=72305&edit=1
ID: 72305
Updated by: cmb@php.net
Reported by: php at abiusx dot com
Summary: ReflectionParameter::isCallable is not implemented
properly
Status: Analyzed
Type: Bug
Package: Reflection related
Operating System: OS X
PHP Version: 7.0.7
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
For the record, this had to be postponed to PHP 8[1], and is still
work in progress.
[1] <https://externals.io/message/105970>
Previous Comments:
------------------------------------------------------------------------
[2018-02-23 22:32:54] cmb@php.net
Related To: Bug #69987
------------------------------------------------------------------------
[2017-01-11 09:13:56] krakjoe@php.net
Christoph, assigning this to you, can you chase Anatol and find out if this is okay for 7.0.
It's fine in 7.1 and master.
Commit when confirmed, thank you.
------------------------------------------------------------------------
[2016-12-10 18:57:40] cmb@php.net
The following patch has been added/updated:
Patch Name: reflection-callable-poc
Revision: 1481396260
URL: https://bugs.php.net/patch-display.php?bug=72305&patch=reflection-callable-poc&revision=1481396260
------------------------------------------------------------------------
[2016-12-10 18:36:49] cmb@php.net
If I'm not mistaken, the API is available as of PHP 7.0.0 by means of
ZEND_ARG_CALLABLE_INFO()[1]. So "only" the arginfo would have to be updated.
[1] <https://github.com/php/php-src/blob/PHP-7.0.0/Zend/zend_API.h#L106>
------------------------------------------------------------------------
[2016-06-08 04:00:02] pollita@php.net
Your analysis is correct. Internal functions don't /really/ have typehints in the way that
userland functions do. What we have instead is c-array which says "object-of-class",
"array", or "other", and whether or not the arg is taken by reference. In other
words, just about the least possible amount of metadata that makes sense.
Types *are* verified for internal functions at runtime, but only during the call during dispatch to
a magic function which plucks args off the stack and coerces them as needed. This is unfortunately
entirely opaque to Reflection. There's just no means to gain visibility using the current
extension api structures.
So to the meat of the issue; Can we fix it? Yes, but not trivially, and certainly not in time for
7.1.
Sorry... :/
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=72305
--
Edit this bug report at https://bugs.php.net/bug.php?id=72305&edit=1
Thread (7 messages)