| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2016-01-02 07:36 UTC] laruence@php.net
 
-Assigned To:
+Assigned To: laruence
  [2016-01-02 07:36 UTC] laruence@php.net
  [2021-07-09 14:18 UTC] cmb@php.net
 
-Status:      Assigned
+Status:      Verified
-Type:        Bug
+Type:        Documentation Problem
-Assigned To: laruence
+Assigned To:
  [2021-07-09 14:18 UTC] cmb@php.net
  | 
    |||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 13:00:02 2025 UTC | 
Description: ------------ ReflectionFunction::getStaticVariables returns the variables defined in a "use" clause of an anonymous function even though they are not specifically declared as "static" within the function. This might be an internal implementation detail of how "use" works but they should not be reported as "static" variables in terms of reflection. Test script: --------------- $var = 6; $a = function() use ($var){ echo $var; }; $reflected = new \ReflectionFunction($a); var_export($reflected->getStaticVariables()); Expected result: ---------------- Should not have 'var' listed as a static variable. array( ) Actual result: -------------- Has 'var' listed as a static variable array('var' => 6)