php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #80071 Expose closure uses through reflection
Submitted: 2020-09-07 07:48 UTC Modified: 2021-05-21 13:27 UTC
From: michael dot vorisek at email dot cz Assigned: krakjoe (profile)
Status: Closed Package: Reflection related
PHP Version: 7.4.10 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
6 + 19 = ?
Subscribe to this entry?

 
 [2020-09-07 07:48 UTC] michael dot vorisek at email dot cz
Description:
------------
Reflection should provide full access to all all function details.

"use" variables should be accessible as well

usecase: https://github.com/atk4/core/pull/272/files#diff-08f44384ad9646881f3b84d38f3e8d92R54

like function is checked if it is bound, there should be also a check if function uses "use"

Test script:
---------------
this is currently not possible, this is a feature request

Actual result:
--------------
n/a

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-06 14:56 UTC] nikic@php.net
-Summary: Function "use" variables must be accessible thru reflection +Summary: Expose closure uses through reflection
 [2020-10-06 14:56 UTC] nikic@php.net
Uses are accessible as part of getStaticVariables(), though not distinguished from other static variables.
 [2021-05-21 13:27 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2021-05-21 13:27 UTC] krakjoe@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php

This will be included in 8.1
 [2021-05-21 14:13 UTC] m at m dot cz
Thanks! For the record, implemented in https://github.com/php/php-src/commit/b227a722859e83fdba230f746477f6322ae33609
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC