Prior to PHP 5.4.0 only: Querying the host operating system (if supported
and allowed by the OS). This uses an algorithm
that has to guess the timezone. This is by no means going to work correctly for
every situation. A warning is shown when this stage is reached. Do not rely on it to be guessed
correctly, and set date.timezone to the correct timezone
instead.

If none of the above succeed, date_default_timezone_get()
will return a default timezone of UTC.

For the reason that date_default_timezone_get() throws an error when the timezone isn't set in php.ini and then returns a default chosen by the system (rather than returning false to indicate to the script that a timezone hasn't been set), I've found that the following works when you want a script to detect when the ini value has not been set and want the script itself to choose a default in that case, while still allowing bootstrap scripts to set their own default using date_default_timezone_set().