<?php
declare(strict_types=1);
function jsonResponse(array $payload,int $status=200): never {
    http_response_code($status); header('Content-Type: application/json; charset=utf-8');
    header('X-Content-Type-Options: nosniff');
    echo json_encode($payload,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE|JSON_THROW_ON_ERROR);
    exit;
}
// jsonResponse(['data'=>['id'=>123]]);
// jsonResponse(['error'=>['message'=>'Not found']],404);
