From 94ed29f47d917e58ccf38baee7dd38d74f7de9dd Mon Sep 17 00:00:00 2001 From: kojidev Date: Tue, 17 Dec 2024 21:43:44 +0300 Subject: [PATCH] ignore args --- builtin-functions/kphp-full/_functions.txt | 2 +- runtime/interface.cpp | 14 +++++++++++++- runtime/interface.h | 4 +++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/builtin-functions/kphp-full/_functions.txt b/builtin-functions/kphp-full/_functions.txt index 8957e33aff..cbb75870d7 100644 --- a/builtin-functions/kphp-full/_functions.txt +++ b/builtin-functions/kphp-full/_functions.txt @@ -141,7 +141,7 @@ function ob_get_flush () ::: string | false; function ob_get_length () ::: int | false; function ob_get_level () ::: int; -function headers_sent () ::: bool; +function headers_sent (string &$filename = null, int &$line = null) ::: bool; function header ($str ::: string, $replace ::: bool = true, $http_response_code ::: int = 0) ::: void; function headers_list () ::: string[]; function send_http_103_early_hints($headers ::: string[]) ::: void; diff --git a/runtime/interface.cpp b/runtime/interface.cpp index 8273902696..44ef9e319c 100644 --- a/runtime/interface.cpp +++ b/runtime/interface.cpp @@ -370,7 +370,19 @@ array f$headers_list() { return result; } -bool f$headers_sent() { +Optional &get_dummy_headers_sent_filename() noexcept { + static Optional filename; + return filename; +} + +Optional &get_dummy_headers_sent_line() noexcept { + static Optional dummy_line; + return dummy_line; +} + +bool f$headers_sent(Optional &filename, Optional &line) { + (void)filename; + (void)line; return headers_sent; } diff --git a/runtime/interface.h b/runtime/interface.h index ffa4c121b0..7d8de552e6 100644 --- a/runtime/interface.h +++ b/runtime/interface.h @@ -47,7 +47,9 @@ int64_t f$ob_get_level(); void f$flush(); -bool f$headers_sent(); +Optional &get_dummy_headers_sent_filename() noexcept; +Optional &get_dummy_headers_sent_line() noexcept; +bool f$headers_sent(Optional &filename = get_dummy_headers_sent_filename(), Optional &line = get_dummy_headers_sent_line()); void f$header(const string &str, bool replace = true, int64_t http_response_code = 0);