<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Predefined Constants</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reserved.classes.html">Predefined Classes</a></div> <div class="next" style="text-align: right; float: right;"><a href="resource.html">List of Resource Types</a></div> <div class="up"><a href="reserved.html">List of Reserved Words</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="reserved.constants" class="sect1"> <h2 class="title">Predefined Constants</h2> <div class="sect2" id="reserved.constants.core"> <h3 class="title">Core Predefined Constants</h3> <p class="simpara"> These constants are defined by the PHP core. This includes PHP, the Zend engine, and SAPI modules. </p> <dl> <dt id="constant.php-version"> <span class="term"> <strong><code>PHP_VERSION</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> The current PHP version as a string in "major.minor.release[extra]" notation. </span> </dd> </dt> <dt id="constant.php-major-version"> <span class="term"> <strong><code>PHP_MAJOR_VERSION</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> The current PHP "major" version as an integer (e.g., int(5) from version "5.2.7-extra"). Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-minor-version"> <span class="term"> <strong><code>PHP_MINOR_VERSION</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> The current PHP "minor" version as an integer (e.g., int(2) from version "5.2.7-extra"). Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-release-version"> <span class="term"> <strong><code>PHP_RELEASE_VERSION</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> The current PHP "release" version as an integer (e.g., int(7) from version "5.2.7-extra"). Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-version-id"> <span class="term"> <strong><code>PHP_VERSION_ID</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> The current PHP version as an integer, useful for version comparisons (e.g., int(50207) from version "5.2.7-extra"). Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-extra-version"> <span class="term"> <strong><code>PHP_EXTRA_VERSION</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> 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. Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-zts"> <span class="term"> <strong><code>PHP_ZTS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-debug"> <span class="term"> <strong><code>PHP_DEBUG</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 5.2.7. </span> </dd> </dt> <dt id="constant.php-maxpathlen"> <span class="term"> <strong><code>PHP_MAXPATHLEN</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> The maximum length of filenames (including path) supported by this build of PHP. Available since PHP 5.3.0. </span> </dd> </dt> <dt id="constant.php-os"> <span class="term"> <strong><code>PHP_OS</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-sapi"> <span class="term"> <strong><code>PHP_SAPI</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> The Server API for this build of PHP. Available since PHP 4.2.0. See also <span class="function"><a href="function.php-sapi-name.html" class="function">php_sapi_name()</a></span>. </span> </dd> </dt> <dt id="constant.php-eol"> <span class="term"> <strong><code>PHP_EOL</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> The correct 'End Of Line' symbol for this platform. Available since PHP 4.3.10 and PHP 5.0.2 </span> </dd> </dt> <dt id="constant.php-int-max"> <span class="term"> <strong><code>PHP_INT_MAX</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> The largest integer supported in this build of PHP. Usually int(2147483647). Available since PHP 4.4.0 and PHP 5.0.5 </span> </dd> </dt> <dt id="constant.php-int-size"> <span class="term"> <strong><code>PHP_INT_SIZE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 4.4.0 and PHP 5.0.5 </span> </dd> </dt> <dt id="constant.default-include-path"> <span class="term"> <strong><code>DEFAULT_INCLUDE_PATH</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.pear-install-dir"> <span class="term"> <strong><code>PEAR_INSTALL_DIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.pear-extension-dir"> <span class="term"> <strong><code>PEAR_EXTENSION_DIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-extension-dir"> <span class="term"> <strong><code>PHP_EXTENSION_DIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-prefix"> <span class="term"> <strong><code>PHP_PREFIX</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> The value "--prefix" was set to at configure. Available since PHP 4.3.0. </span> </dd> </dt> <dt id="constant.php-bindir"> <span class="term"> <strong><code>PHP_BINDIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> Specifies where the binaries were installed into. </span> </dd> </dt> <dt id="constant.php-binary"> <span class="term"> <strong><code>PHP_BINARY</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> Specifies the PHP binary path during script execution. Available since PHP 5.4. </span> </dd> </dt> <dt id="constant.php-mandir"> <span class="term"> <strong><code>PHP_MANDIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> Specifies where the manpages were installed into. Available since PHP 5.3.7. </span> </dd> </dt> <dt id="constant.php-libdir"> <span class="term"> <strong><code>PHP_LIBDIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-datadir"> <span class="term"> <strong><code>PHP_DATADIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-sysconfdir"> <span class="term"> <strong><code>PHP_SYSCONFDIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-localstatedir"> <span class="term"> <strong><code>PHP_LOCALSTATEDIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-config-file-path"> <span class="term"> <strong><code>PHP_CONFIG_FILE_PATH</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-config-file-scan-dir"> <span class="term"> <strong><code>PHP_CONFIG_FILE_SCAN_DIR</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.php-shlib-suffix"> <span class="term"> <strong><code>PHP_SHLIB_SUFFIX</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </span> <dd> <span class="simpara"> The build-platform's shared library suffix, such as "so" (most Unixes) or "dll" (Windows). Available since PHP 4.3.0 </span> </dd> </dt> <dt id="constant.e-error"> <span class="term"> <strong><code>E_ERROR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> <a href="errorfunc.constants.html" class="link">Error reporting constant</a> </span> </dd> </dt> <dt id="constant.e-warning"> <span class="term"> <strong><code>E_WARNING</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-parse"> <span class="term"> <strong><code>E_PARSE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-notice"> <span class="term"> <strong><code>E_NOTICE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-core-error"> <span class="term"> <strong><code>E_CORE_ERROR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-core-warning"> <span class="term"> <strong><code>E_CORE_WARNING</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-compile-error"> <span class="term"> <strong><code>E_COMPILE_ERROR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-compile-warning"> <span class="term"> <strong><code>E_COMPILE_WARNING</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-user-error"> <span class="term"> <strong><code>E_USER_ERROR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-user-warning"> <span class="term"> <strong><code>E_USER_WARNING</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-user-notice"> <span class="term"> <strong><code>E_USER_NOTICE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-deprecated"> <span class="term"> <strong><code>E_DEPRECATED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 5.3.0 </span> </dd> </dt> <dt id="constant.e-user-deprecated"> <span class="term"> <strong><code>E_USER_DEPRECATED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 5.3.0 </span> </dd> </dt> <dt id="constant.e-all"> <span class="term"> <strong><code>E_ALL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> </span> </dd> </dt> <dt id="constant.e-strict"> <span class="term"> <strong><code>E_STRICT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 5.0.0 </span> </dd> </dt> <dt id="constant.compiler-halt-offset"> <span class="term"> <strong><code>__COMPILER_HALT_OFFSET__</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </span> <dd> <span class="simpara"> Available since PHP 5.1.0 </span> </dd> </dt> <dt id="constant.true"> <span class="term"> <strong><code>TRUE</code></strong> (<span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span>) </span> <dd> <span class="simpara"> See <a href="language.types.boolean.html" class="link">Booleans</a>. </span> </dd> </dt> <dt id="constant.false"> <span class="term"> <strong><code>FALSE</code></strong> (<span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span>) </span> <dd> <span class="simpara"> See <a href="language.types.boolean.html" class="link">Booleans</a>. </span> </dd> </dt> <dt id="constant.null"> <span class="term"> <strong><code>NULL</code></strong> (<span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span>) </span> <dd> <span class="simpara"> See <a href="language.types.null.html" class="link">Null</a>. </span> </dd> </dt> </dl> <p class="para"> See also: <a href="language.constants.predefined.html" class="link">Magic constants</a>. </p> </div> <div class="sect2" id="reserved.constants.standard"> <h3 class="title">Standard Predefined Constants</h3> <p class="simpara"> All constants from <a href="extensions.membership.html#extensions.membership.core" class="link">core extensions</a> are defined in PHP by default. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reserved.classes.html">Predefined Classes</a></div> <div class="next" style="text-align: right; float: right;"><a href="resource.html">List of Resource Types</a></div> <div class="up"><a href="reserved.html">List of Reserved Words</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>