https://bugzilla.wikimedia.org/show_bug.cgi?id=52129

       Web browser: ---
            Bug ID: 52129
           Summary: Globals should be explicitly declared in PHP
           Product: MediaWiki
           Version: 1.22-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

I've probably chosen the worst possible file as an example, but see this patch:
https://gerrit.wikimedia.org/r/#/c/76208/

When MediaWiki source files declare variables in their top-level scope, the
implicit assumption is that we are declaring them as global.  However, if any
part of the MediaWiki initialization code was called from within local
(function-level) scope, PHP will no longer globally scope these variables.

The only solution is to explicitly declare the variables with a top-level
"global", anywhere we expect to refer to the variable from another file, i.e.,
for every global.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to