format-negative-timestamp.phpt 369 B

123456789101112131415161718192021222324
  1. --TEST--
  2. strtotime() - Format: @timestamps
  3. --FILE--
  4. <?php
  5. date_default_timezone_set("GMT");
  6. $i = 5;
  7. $max = getrandmax();
  8. $max_2 = $max / 2;
  9. while($i--) {
  10. $new_tm = rand(1, $max);
  11. if ($new_tm > $max_2)
  12. $new_tm *= -1;
  13. if (strtotime("@$new_tm") != $new_tm) {
  14. echo "Error when parsing: @$new_tm\n";
  15. }
  16. }
  17. echo "done!";
  18. ?>
  19. --EXPECT--
  20. done!