title: php 7.1/7.0 default timezone issue
body: <p>i am a bit confused while investigating default timezone detection in php 7.1/7.0:
  WE have a simple php CLI code :</p>
  
  <pre><code> php -r "var_dump(ini_get('date.timezone'),date_default_timezone_get());"
  </code></pre>
  
  <p>and according to php.net documentation (<a href="http://php.net/manual/en/function.date-default-timezone-get.php" rel="nofollow noreferrer">http://php.net/manual/en/function.date-default-timezone-get.php</a>) we should have 'UTC' as a result of date_default_timezone_get function because we do not set timezone in php.ini.
  And here the output of this code:</p>
  
  <pre><code>Command line code:1:
  string(0) ""
  Command line code:1:
  string(16) "America/Anguilla"
  </code></pre>
  
  <p>here we can see that ini_get('date.timezone') equals to empty string, but 
  date_default_timezone_get equals to America/Anguilla</p>
  
  <p>i am using: <code>PHP 7.1.12-3+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Dec 14 2017 15:58:40) ( NTS )</code>.</p>
  
  <p><strong>php -i</strong> shows us:</p>
  
  <p>date</p>
  
  <pre><code>date/time support =&gt; enabled
  timelib version =&gt; 2016.05
  "Olson" Timezone Database Version =&gt; 0.system
  Timezone Database =&gt; internal
  Default timezone =&gt; America/Anguilla
  </code></pre>
  
  <p>By the way timezone on this server is: <code>Asia/Qatar (AST, +0300)</code>, but as i know it should not be taken by php from php 5.4.</p>
  
  <p>Could you help me please to find out where is this value for this timezone was set?</p>
  
  <p>UPDATED:
  This a php 7.1 source code of timezone detection function:</p>
  
  <pre><code>       static char* guess_timezone(const timelib_tzdb *tzdb)
      {
          /* Checking configure timezone */
          if (DATEG(timezone) &amp;&amp; (strlen(DATEG(timezone))) &gt; 0) {
              return DATEG(timezone);
          }
          /* Check config setting for default timezone */
          if (!DATEG(default_timezone)) {
              /* Special case: ext/date wasn't initialized yet */
              zval *ztz;
  
              if (NULL != (ztz = cfg_get_entry("date.timezone", 
  
  sizeof("date.timezone")))
              &amp;&amp; Z_TYPE_P(ztz) == IS_STRING &amp;&amp; Z_STRLEN_P(ztz) &gt; 0 &amp;&amp; timelib_timezone_id_is_valid(Z_STRVAL_P(ztz), tzdb)) {
              return Z_STRVAL_P(ztz);
          }
      } else if (*DATEG(default_timezone)) {
          if (DATEG(timezone_valid) == 1) {
              return DATEG(default_timezone);
          }
  
          if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
              php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
              return "UTC";
          }
  
          DATEG(timezone_valid) = 1;
          return DATEG(default_timezone);
      }
      /* Fallback to UTC */
      return "UTC";
  }
  </code></pre>
  
  <p>In php 5.6 and below  i see that php generate a warning in case of timezone not set:</p>
  
  <pre><code> /* Fallback to UTC */
      php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
      return "UTC";
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>Best Regards,</p>
  
  <p>Dmitry</p>