You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
edsonmedina edited this page Dec 16, 2014
·
3 revisions
#Static variable
function foo()
{
static $cache;
//...
}
##Why is this a testing issue?
While useful sometimes (ie: caching or singletons), the value of static variables can't be controlled from outside the method, and thus it's unpredictable. If it's unpredictable, it's untestable.