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

/hphp/test/slow/ext_datetime/mktime.php

http://github.com/facebook/hiphop-php
PHP | 30 lines | 18 code | 6 blank | 6 comment | 1 complexity | 318d61226b7af12e4437cfe140c33932 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. <?hh
  2. function VS($x, $y) {
  3. var_dump($x === $y);
  4. if ($x !== $y) { echo "Failed: $y\n"; }
  5. }
  6. <<__EntryPoint>>
  7. function main_mktime() {
  8. $lastday = mktime(0, 0, 0, 3, 0, 2000);
  9. var_dump(strftime("Last day in Feb 2000 is: %d", $lastday));
  10. /**
  11. * We are not supporting negative parameters
  12. * lastday = f_mktime(0, 0, 0, 4, -31, 2000);
  13. * VS(f_strftime("Last day in Feb 2000 is: %d", lastday),
  14. * "Last day in Feb 2000 is: 29");
  15. */
  16. VS(date("M-d-Y", mktime(0, 0, 0, 12, 32, 1997)), "Jan-01-1998");
  17. VS(date("M-d-Y", mktime(0, 0, 0, 13, 1, 1997)), "Jan-01-1998");
  18. VS(date("M-d-Y", mktime(0, 0, 0, 1, 1, 1998)), "Jan-01-1998");
  19. VS(date("M-d-Y", mktime(0, 0, 0, 1, 1, 98)), "Jan-01-1998");
  20. VS(date("M-d-Y", mktime(0, 0, 0, 1, 1, 1900)), "Jan-01-1900");
  21. VS(date("M-d-Y", mktime(0, 0, 0, 1, 1, 2100)), "Jan-01-2100");
  22. VS(date("M-d-Y", mktime(0, 0, 0, 1, 1, 110)), "Jan-01-0110");
  23. VS(date("h", mktime(9)), "09");
  24. }