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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: michael dot vorisek at email dot cz
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 09:01:38 2025 UTC