Predefined Constants

Core Predefined Constants

These constants are defined by the PHP core. This includes PHP, the Zend engine, and SAPI modules.

PHP_VERSION (string)
The current PHP version as a string in "major.minor.release[extra]" notation.
PHP_MAJOR_VERSION (int)
The current PHP "major" version as an integer (e.g., int(5) from version "5.2.7-extra").
PHP_MINOR_VERSION (int)
The current PHP "minor" version as an integer (e.g., int(2) from version "5.2.7-extra").
PHP_RELEASE_VERSION (int)
The current PHP "release" version as an integer (e.g., int(7) from version "5.2.7-extra").
PHP_VERSION_ID (int)
The current PHP version as an integer, useful for version comparisons (e.g., int(50207) from version "5.2.7-extra").
PHP_EXTRA_VERSION (string)
The current PHP "extra" version as a string (e.g., '-extra' from version "5.2.7-extra"). Often used by distribution vendors to indicate a package version.
ZEND_THREAD_SAFE (bool)
Indicates whether the current build of PHP is thread safe.
ZEND_DEBUG_BUILD (bool)
Indicates whether the current build of PHP is a debug build.
PHP_ZTS (bool) Alias of ZEND_THREAD_SAFE
Indicates whether the current build of PHP is thread safe.
PHP_DEBUG (bool) Alias of ZEND_DEBUG_BUILD
Indicates whether the current build of PHP is a debug build.
DEBUG_BACKTRACE_PROVIDE_OBJECT (int)
Populate the "object" index.
DEBUG_BACKTRACE_IGNORE_ARGS (int)
Don't include the argument information for functions in the stack trace.
PHP_MAXPATHLEN (int)
The maximum length of filenames (including path) supported by this build of PHP.
PHP_OS (string)
The operating system PHP was built for.
PHP_OS_FAMILY (string)
The operating system family PHP was built for. One of 'Windows', 'BSD', 'Darwin', 'Solaris', 'Linux' or 'Unknown'. Available as of PHP 7.2.0.
PHP_SAPI (string)
The Server API for this build of PHP. See also php_sapi_name().
PHP_EOL (