<?php
declare(strict_types=1);

function flash_set(string $type, string $msg): void {
  $_SESSION['_flash'] = ['type' => $type, 'msg' => $msg];
}

function flash_get(): ?array {
  if (empty($_SESSION['_flash'])) return null;
  $f = $_SESSION['_flash'];
  unset($_SESSION['_flash']);
  return $f;
}
