|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62510 Some suggestions for static variables inside functions and methods
Submitted: 2012-07-08 18:06 UTC Modified: -
From: dev at pp3345 dot de Assigned:
Status: Open Package: Reflection related
PHP Version: 5.4.4 OS:
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
45 + 32 = ?
Subscribe to this entry?

 [2012-07-08 18:06 UTC] dev at pp3345 dot de
With Reflection, it is possible to get and set static properties in classes, 
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 
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: - It 
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 


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jan 21 20:01:23 2020 UTC