From f9a042ee6ada9559f54faa34340826109b8b9dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 17 Jul 2025 12:26:52 +0200 Subject: [PATCH] main: Add `PHP_BUILD_PROVIDER` userland constant This constant can be handy for tools like PIE to determine the origin of a PHP binary to provide better output / diagnostics. see php/pie#275 see php/php-src#18168 --- NEWS | 3 +++ UPGRADING | 1 + main/main.stub.php | 8 ++++++++ main/main_arginfo.h | 5 ++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6929e7b2d2f14..6013c03212f97 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.5.0alpha3 +- Core: + . Added PHP_BUILD_PROVIDER constant. (timwolla) + - Sockets: . socket_set_option for multicast context throws a ValueError when the socket family is not of AF_INET/AF_INET6 family. (David Carlier) diff --git a/UPGRADING b/UPGRADING index d737e889393b6..2c561a52bb023 100644 --- a/UPGRADING +++ b/UPGRADING @@ -520,6 +520,7 @@ PHP 8.5 UPGRADE NOTES - Core: . PHP_BUILD_DATE. + . PHP_BUILD_PROVIDER. - Curl: . CURLINFO_USED_PROXY. diff --git a/main/main.stub.php b/main/main.stub.php index 3359d4a1cd0bf..2732ccd290fa4 100644 --- a/main/main.stub.php +++ b/main/main.stub.php @@ -41,6 +41,14 @@ */ const PHP_BUILD_DATE = UNKNOWN; +#ifdef PHP_BUILD_PROVIDER +/** + * @var string + * @cvalue PHP_BUILD_PROVIDER + */ +const PHP_BUILD_PROVIDER = UNKNOWN; +#endif + /** * @var bool * @cvalue PHP_ZTS diff --git a/main/main_arginfo.h b/main/main_arginfo.h index 922af3aff0629..3aa0b07e42c87 100644 --- a/main/main_arginfo.h +++ b/main/main_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: cb5c9a3e48b18a773264378099267550ca9e4fc1 */ + * Stub hash: e8b81aa6f03d36f35def2bb1fcc3563b284a113b */ static void register_main_symbols(int module_number) { @@ -10,6 +10,9 @@ static void register_main_symbols(int module_number) REGISTER_STRING_CONSTANT("PHP_EXTRA_VERSION", PHP_EXTRA_VERSION, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PHP_VERSION_ID", PHP_VERSION_ID, CONST_PERSISTENT); REGISTER_STRING_CONSTANT("PHP_BUILD_DATE", php_build_date, CONST_PERSISTENT); +#if defined(PHP_BUILD_PROVIDER) + REGISTER_STRING_CONSTANT("PHP_BUILD_PROVIDER", PHP_BUILD_PROVIDER, CONST_PERSISTENT); +#endif REGISTER_BOOL_CONSTANT("PHP_ZTS", PHP_ZTS, CONST_PERSISTENT); REGISTER_BOOL_CONSTANT("PHP_DEBUG", PHP_DEBUG, CONST_PERSISTENT); REGISTER_STRING_CONSTANT("PHP_OS", PHP_OS_STR, CONST_PERSISTENT);