DST nigthmare in php

I hate Daylight Saving Time since my early childhood. There is nothing more that bad, as waking up earlier in autumn. But someone have decided, that this will save a little more money on electricity, programmers should deal with it somehow.
But there is something, that I don’t like even more – it is Israel Daylight Saving Time. And programmers working with Israeli customers, should deal somehow with it also.

I developed recently a widget for displaying Zmanim data in WordPress sites (special time during the day, when it is possible to pray). I used pretty simple DST detection mechanism, until one of users complained, that in Israel time did’t switched recently. Jews like to do things differently, then others and time is no exception.
There are lot of ways how to deal with this problem. Microsoft just hardcoded all dates till 2023 in Windows 7. Now we know approximate End-Of-Life of Windows 7 😉
I have the following function to deal with DST in Israel and all over the world:

Note: this code misses detection either it is Jewish leap year or not. If leap, then month when DST window is false is 8.

Update: I redesigned mechanism of detection weekend between Rosh haShana and Yom Kippur.