DatePeriod_properties1.phpt 695 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. DatePeriod: Test read only properties
  3. --INI--
  4. date.timezone=UTC
  5. --FILE--
  6. <?php
  7. $start = new DateTime;
  8. $interval = new DateInterval('P1D');
  9. $end = new DateTime;
  10. $period = new DatePeriod($start, $interval, $end);
  11. echo "recurrences: ";
  12. var_dump($period->recurrences);
  13. echo "include_start_date: ";
  14. var_dump($period->include_start_date);
  15. echo "start: ";
  16. var_dump($period->start == $start);
  17. echo "current: ";
  18. var_dump($period->current);
  19. echo "end: ";
  20. var_dump($period->end == $end);
  21. echo "interval: ";
  22. var_dump($period->interval->format("%R%d"));
  23. ?>
  24. --EXPECT--
  25. recurrences: int(1)
  26. include_start_date: bool(true)
  27. start: bool(true)
  28. current: NULL
  29. end: bool(true)
  30. interval: string(2) "+1"