<?php
$dateStart = new DateTime('2014-01-01');
$dateStart = new DateTime('2014-01-05');
$period = new DatePeriod($dateStart, new DateInterval('P1D'), $dateEnd);
$periods = iterator_to_array($period);
print_r($periods);
Warning: Undefined variable $dateEnd in /in/0Cps6 on line 5
Deprecated: DatePeriod::__construct(): Passing null to parameter #3 ($end) of type int is deprecated in /in/0Cps6 on line 5
Fatal error: Uncaught DateMalformedPeriodStringException: DatePeriod::__construct(): Recurrence count must be greater than 0 in /in/0Cps6:5
Stack trace:
#0 /in/0Cps6(5): DatePeriod->__construct(Object(DateTime), Object(DateInterval), NULL)
#1 {main}
thrown in /in/0Cps6 on line 5
Process exited with code 255.
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19
Warning: Undefined variable $dateEnd in /in/0Cps6 on line 5
Deprecated: DatePeriod::__construct(): Passing null to parameter #3 ($end) of type int is deprecated in /in/0Cps6 on line 5
Fatal error: Uncaught Exception: DatePeriod::__construct(): Recurrence count must be greater than 0 in /in/0Cps6:5
Stack trace:
#0 /in/0Cps6(5): DatePeriod->__construct(Object(DateTime), Object(DateInterval), NULL)
#1 {main}
thrown in /in/0Cps6 on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $dateEnd in /in/0Cps6 on line 5
Fatal error: Uncaught Exception: DatePeriod::__construct(): Recurrence count must be greater than 0 in /in/0Cps6:5
Stack trace:
#0 /in/0Cps6(5): DatePeriod->__construct(Object(DateTime), Object(DateInterval), NULL)
#1 {main}
thrown in /in/0Cps6 on line 5
Process exited with code 255.
Notice: Undefined variable: dateEnd in /in/0Cps6 on line 5
Fatal error: Uncaught Exception: DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0 in /in/0Cps6:5
Stack trace:
#0 /in/0Cps6(5): DatePeriod->__construct(Object(DateTime), Object(DateInterval), NULL)
#1 {main}
thrown in /in/0Cps6 on line 5
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Exception: DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0 in /in/0Cps6:5
Stack trace:
#0 /in/0Cps6(5): DatePeriod->__construct(Object(DateTime), Object(DateInterval), NULL)
#1 {main}
thrown in /in/0Cps6 on line 5
Process exited with code 255.