|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-09-23 15:35 UTC] will dot baumbach at iselinc dot com
Description: ------------ --- From manual page: https://php.net/dateperiod.construct --- As of 7.2.19+, 7.3.6+ and 7.4.0+ the DatePeriod constructor recurrences argument, no longer accepts 0. Instead an exception is thrown. This was an undocumented change in the 7.2.19 change log and on the DatePeriod documentation page. Fatal error: Uncaught Exception: DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0 in /in/vjVTF:6 Stack trace: #0 /in/vjVTF(6): DatePeriod->__construct(Object(DateTimeImmutable), Object(DateInterval), 0) Test script: --------------- new \DatePeriod(new \DateTimeImmutable(), new \DateInterval('P1D'), 0); https://3v4l.org/vjVTF PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Well, the ISO 8061 *draft*[1] indeed allows zero recurrences: recurringIndicator = "R", {digit}, "/" ; digit = positiveDigit | "0" ; This does not necessarily imply, though, that the final standard also allows zero recurrences. [1] <https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf>