Ragazzi, mi trovo un modify->('+1 day') che non funziona in php 8
Qualcuno vede cosa sbaglio ?
Codice PHP:
if(isset($_POST['grafico'])) { $star_time = new DateTime($_POST['from']); $stop_time = new DateTime($_POST['togo']); } else { $star_time = new DateTime($start); $stop_time = new DateTime($date); } echo $star_time->format('d/m/y')." - ".$stop_time->format('Y-m-d'); for($i = $star_time; $i < $stop_time; $i->modify('+1 day') ) { $labels[] = gdate($i->format("Y-m-d")); $iDay = $i->format("Y-m-d 00:00:00"); $fDay = $i->format("Y-m-d 23:59:59");
$stmt = $indexPage->runQuery("SELECT id, nome, cognome FROM UTENTI WHERE level > 1 ORDER BY id ASC"); $stmt->execute(); while($adm = $stmt->fetch(PDO::FETCH_ASSOC)) { $stmt_contacts = $indexPage->runQuery("SELECT id FROM CONTACTS WHERE risp='R' && cDate BETWEEN '$iDay' AND '$fDay' && user=:usr"); $stmt_contacts->execute(array(":usr"=>$adm['id']));
if(!in_array($adm['id'], $user)) { $user[$adm['id']] = $adm['id']; $background[$adm['id']] = "rgb(".rand (0, 255).", ".rand (0, 255).", ".rand (0, 255).")"; $nome[$adm['id']] = $adm['cognome']." ".$adm['nome']; } $count[$adm['id']] .= $stmt_contacts->rowCount(); } }