<?php
$start = new DateTime('01-01-2015');
$end = new DateTime('06-01-2015');
$period = new DatePeriod($start, new DateInterval('P1W'), $end);
foreach ($period as $week) {
var_dump($week->format('d/m/Y'));
}
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
string(10) "01/01/2015"
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DatePeriod' not found in /in/CKP3g on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/CKP3g on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/CKP3g on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/CKP3g on line 3