fabpot/Twig — comment on commit 2c7b5651329dac0afb2ff4f58809dfa2778b153d
File:  line 0
By stof:

@nikic the typo is fixed in the next commit.

staging is used to be able to register functions (and filters, tests...) before extensions by putting them in the staging property instead of flushing the property at that time. Without the change, function provided by extensions are processed when adding a standalone function which means that subsequent extensions were ignored for the functions (and same for other stuff by changing things accordingly).

With the new implementation, functions are flushed the first time they are needed, i.e. when parsing the first template. At this time, we are sure that the setup of the environment is completed (except if the user is doing crappy things not supported by Twig by adding new extensions after parsing a template)