$method(); $t2 = microtime(true); $time = $t2 - $t1; $response = [ 'result' => $result, 'time' => $time, 'data' => null ]; echo json_encode($response); die(); } } } echo json_encode([]);