Bug 19093. Previously {{#switch:foo|bar|#default=baz}} would behave
differently from {{#switch:foo|#default|bar=baz}}, even though they'd
behave identically if "#default" was replaced by "foo".
I changed switchObj but not switchHook. In testing, switchObj was the
only method that seemed to be used, and I didn't want to make untested
changes to switchHook, so if that's used, the behavior may remain in
some cases. It seems like code is duplicated between them -- whatever
the difference is, that should probably be factored out.
This passes all existing parser tests for #switch, of which there are
none, so don't blame me if it breaks something. ;)
Uses DateTime class in PHP 5.2+ to support dates outside the 1970-2038 range. On earlier versions will still fall back to strtotime with the old 32-bit Unix timestamp range limitations.
Patch by rememberthedot -- https://bugzilla.wikimedia.org/attachment.cgi?id=5416
Added a couple quick parser test cases to confirm the new behavior. However I am seeing some annoyances with how input time zones are handled, so we'll want to clean that up at some point. :)