After moving a form handler to PHP 8, the log is full of Warning: Undefined array key "interval" and Warning: Undefined variable $unit. The old server showed nothing. The code reads $_POST['interval'] directly, and $unit is only assigned inside an if branch.
What is the proper way to handle values that may be missing? I see isset(), empty(), ?? and array_key_exists() all recommended, and I would rather fix the cause than hide the messages.




