Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Instead of polluting the global namespace, this is a perfect use case for drupal_static().
Comment | File | Size | Author |
---|---|---|---|
#1 | 1196812.1-use_drupal_static.patch | 1.73 KB | deviantintegral |
Comments
Comment #1
deviantintegral CreditAttribution: deviantintegral commentedTada!
Comment #2
deekayen CreditAttribution: deekayen commentedIt wasn't a static variable before and making it static now doesn't make sense to me. Removing global declarations isn't the documented intention of the drupal_static function.