Skip to content

Add php_version and php_version_id PHPAPI funcs #11875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ PHPAPI size_t core_globals_offset;

#define SAFE_FILENAME(f) ((f)?(f):"-")

PHPAPI const char *php_version(void)
{
return PHP_VERSION;
}

PHPAPI unsigned int php_version_id(void)
{
return PHP_VERSION_ID;
}

/* {{{ PHP_INI_MH */
static PHP_INI_MH(OnSetFacility)
{
Expand Down
13 changes: 13 additions & 0 deletions main/php_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
#include "SAPI.h"

BEGIN_EXTERN_C()

/* Returns the PHP version 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 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);

PHPAPI zend_result php_request_startup(void);
PHPAPI void php_request_shutdown(void *dummy);
PHPAPI zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module);
Expand Down