From:             dev at pp3345 dot de
Operating system: 
PHP version:      5.4.4
Package:          Reflection related
Bug Type:         Feature/Change Request
Bug description:Some suggestions for static variables inside functions and 
methods

Description:
------------
With Reflection, it is possible to get and set static properties in
classes, 
even 
when they are private or protected. This should also be possible for static

variables inside functions and methods. There is a method 
ReflectionFunctionAbstract::getStaticVariables() that returns the names and

values 
of static variables inside the function. In my opinion, there should also
be a 
function ReflectionFunctionAbstract::setStaticVariable(). 

I'd also like to mention this bug: https://bugs.php.net/bug.php?id=51581 -
It 
was 
declined about two years ago but I think it should be fixed. I suggested in
a 
comment that a solution for the increased memory usage could be a
ini-setting 
(like "reflection.track_static_properties") that enables (should probably
be 
disabled by default) the tracking of the default values of static
properties. If 
this could be done, I also suggest adding a similar function to retrieve
the 
default values of static variables in functions, for example 
ReflectionFunctionAbstract::getDefaultStaticVariables().


-- 
Edit bug report at https://bugs.php.net/bug.php?id=62510&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=62510&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=62510&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=62510&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=62510&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62510&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=62510&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=62510&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=62510&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=62510&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=62510&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=62510&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=62510&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=62510&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=62510&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=62510&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62510&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=62510&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=62510&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=62510&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=62510&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=62510&r=mysqlcfg

Reply via email to