Add php_build_provider() (#18168)

* Add `ZEND_ATTRIBUTE_CONST` to php_version() and php_version_id()

* Add `php_build_provider()`

* Use `php_build_provider()` internally
This commit is contained in:
Tim Düsterhus 2025-03-29 13:29:40 +01:00 committed by GitHub
parent 314219387e
commit 5dd9b0dcef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 18 deletions

View file

@ -28,13 +28,20 @@ BEGIN_EXTERN_C()
* extensions which want to know the version of PHP at run-time, rather than
* the version they were built with at compile-time.
*/
PHPAPI const char *php_version(void);
ZEND_ATTRIBUTE_CONST PHPAPI const char *php_version(void);
/* Returns the PHP version id the engine was built with. This is useful for
* extensions which want to know the version of PHP at run-time, rather than
* the version they were built with at compile-time.
*/
PHPAPI unsigned int php_version_id(void);
ZEND_ATTRIBUTE_CONST PHPAPI unsigned int php_version_id(void);
/* Returns the build provider specified at build time. NULL is returned if
* no build provider was specified. This is useful for extensions which want
* to know the origin of a PHP binary at run-time, for example to provide
* statistics.
*/
ZEND_ATTRIBUTE_CONST PHPAPI const char *php_build_provider(void);
/* Prints the PHP version string for the -v option. It's in main/ so that
* it can be shared between SAPIs.