Work around PHP bugs in timezone validation
PHP < 8 doesn't reject strings starting with + and -, so add a
workaround for that. Also add more extensive tests for invalid timezone.
And also move the code to its own method -- in an ideal world the
validation would be short enough to not need a separate methods, but
PHP's handling of invalid timezones really sucks.
Also work around another bug that exists in PHP master for offsets
larger than 100*60 minutes.
Bug: T315692
Change-Id: I5884ebaed7e435fca27e6e8661876a2e6bb52687