PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/bad/ext/date/tests/mktime-3.php

http://github.com/facebook/hiphop-php
PHP | 20 lines | 19 code | 1 blank | 0 comment | 3 complexity | c6028db29fe7ce8ffa0e75f5cdb78412 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. $tzs = array("America/Toronto", "Europe/Oslo");
  3. $years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, 2001);
  4. foreach ($tzs as $tz) {
  5. echo $tz, "\n";
  6. date_default_timezone_set($tz);
  7. foreach ($years as $year) {
  8. printf("Y: %4d - ", $year);
  9. $ret = mktime(1, 1, 1, 1, 1, $year);
  10. if ($ret == FALSE) {
  11. echo "out of range\n";
  12. } else {
  13. echo date("F ".DATE_ISO8601, $ret), "\n";
  14. }
  15. }
  16. echo "\n";
  17. }
  18. ?>
  19. ===Done===