Magic variables are the same as "zero argument parser functions" except:
- In some cases the parser function is defined but the magic variable (zero-arg) form is not, in which case the zero-arg form should be parsed as a template invocation (T391062)
- In some cases the magic variable form is defined but the parser function is not, in which case the parser function form is, again, parsed as a template invocation.
- Magic Variables are by default cached, so they should only be evaluated one per parse.
Proposal is to add a new flag to FragmentHandler: magicVariable (to go along with the parserFunction flag already there. Another option should be cached which is a boolean which defaults to false, and only applies to zero-argument forms.
At the moment, zero-argument invocations are still supplying a length-1 array to Arguments as well; this should be fixed.