Costanti predefinite

Le costanti qui elencate sono sempre disponibili in quanto parte del core di PHP.

Pre-defined phpcredits() constants
Costanti Descrizione
CREDITS_GROUP (int) A list of the core developers
CREDITS_GENERAL (int) General credits: Language design and concept, PHP authors and SAPI module.
CREDITS_SAPI (int) A list of the server API modules for PHP, and their authors.
CREDITS_MODULES (int) A list of the extension modules for PHP, and their authors.
CREDITS_DOCS (int) The credits for the documentation team.
CREDITS_FULLPAGE (int) Usually used in combination with the other flags. Indicates that a complete stand-alone HTML page needs to be printed including the information indicated by the other flags.
CREDITS_QA (int) The credits for the quality assurance team.
CREDITS_ALL (int) All the credits, equivalent to using: CREDITS_DOCS | CREDITS_GENERAL | CREDITS_GROUP | CREDITS_MODULES | CREDITS_QA | CREDITS_FULLPAGE. It generates a complete stand-alone HTML page with the appropriate tags. This is the default value.
phpinfo() constants
Costanti Descrizione
INFO_GENERAL (int) The configuration line, php.ini location, build date, Web Server, System and more.
INFO_CREDITS (int) PHP Credits. See also phpcredits().
INFO_CONFIGURATION (int) Current Local and Master values for PHP directives. See also ini_get().
INFO_MODULES (int) Loaded modules and their respective settings.
INFO_ENVIRONMENT (int) Environment Variable information that's also available in $_ENV.
INFO_VARIABLES (int) Shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).
INFO_LICENSE (int) PHP License information. See also the » license faq.
INFO_ALL (int) Shows all of the above. This is the default value.
INI mode constants
Costanti Descrizione
INI_USER (int) Entry can be set in user scripts (like with ini_set()) or in the Windows registry. Entry can be set in .user.ini
INI_PERDIR (int) Entry can be set in php.ini, .htaccess, httpd.conf or .user.ini
INI_SYSTEM (int) Entry can be set in php.ini or httpd.conf
INI_ALL (int) Entry can be set anywhere

Assert constants, these values are used to set the assertion options in assert_options().

assert() constants
Costanti Descrizione
ASSERT_ACTIVE (int)

Enable assert() evaluation.

Avviso

This feature has been DEPRECATED as of PHP 8.3.0. Relying on this feature is highly discouraged.

ASSERT_CALLBACK (int)

Callback to call on failed assertions.

Avviso

This feature has been DEPRECATED as of PHP 8.3.0. Relying on this feature is highly discouraged.

ASSERT_BAIL (int)

Terminate execution on failed assertions.

Avviso

This feature has been DEPRECATED as of PHP 8.3.0. Relying on this feature is highly discouraged.

ASSERT_EXCEPTION (int)

Throws an AssertionError for each failed assertion

Avviso

This feature has been DEPRECATED as of PHP 8.3.0. Relying on this feature is highly discouraged.

ASSERT_WARNING (int)

Issues a PHP warning for each failed assertion

Avviso

This feature has been DEPRECATED as of PHP 8.3.0. Relying on this feature is highly discouraged.

ASSERT_QUIET_EVAL (int)

Disable error_reporting during assertion expression evaluation.

Avviso

This feature was REMOVED as of PHP 8.0.0.

The following constants are only available if the host operating system is Windows, and can tell different versioning information so its possible to detect various features and make use of them.

Windows specific constants
Costanti Descrizione
PHP_WINDOWS_VERSION_MAJOR (int) The major version of Windows, this can be either 4 (NT4/Me/98/95), 5 (XP/2003 R2/2003/2000) or 6 (Vista/2008/7/8/8.1).
PHP_WINDOWS_VERSION_MINOR (int) The minor version of Windows, this can be either 0 (Vista/2008/2000/NT4/95), 1 (XP), 2 (2003 R2/2003/XP x64), 10 (98) or 90 (ME).
PHP_WINDOWS_VERSION_BUILD (int) The Windows build number (for example, Windows Vista with SP1 applied is build 6001)
PHP_WINDOWS_VERSION_PLATFORM (int) The platform that PHP currently is running on, this value is 2 on Windows Vista/XP/2000/NT4, Server 2008/2003 and on Windows ME/98/95 this value is 1.
PHP_WINDOWS_VERSION_SP_MAJOR (int) The major version of the service pack installed, this value is 0 if no service pack is installed. For example, Windows XP with service pack 3 installed will make this value 3.
PHP_WINDOWS_VERSION_SP_MINOR (int) The minor version of the service pack installed, this value is 0 if no service pack is installed.
PHP_WINDOWS_VERSION_SUITEMASK (int) The suitemask is a bitmask that can tell if various features of Windows is installed, see the table below for possible bitfield values.
PHP_WINDOWS_VERSION_PRODUCTTYPE (int) This contains the value used to determine the PHP_WINDOWS_NT_* constants. This value may be one of the PHP_WINDOWS_NT_* constants indicating the platform type.
PHP_WINDOWS_NT_DOMAIN_CONTROLLER (int) This is a domain controller
PHP_WINDOWS_NT_SERVER (int) This is a server system (eg. Server 2008/2003/2000), note that if this is a domain controller its reported as PHP_WINDOWS_NT_DOMAIN_CONTROLLER.
PHP_WINDOWS_NT_WORKSTATION (int) This is a workstation system (eg. Vista/XP/2000/NT4)

This table shows a list of features that can be checked for using the PHP_WINDOWS_VERSION_SUITEMASK bitmask.

Windows suitemask bitfields
Bits Description
0x00000004 Microsoft BackOffice components are installed.
0x00000400 Windows Server 2003, Web Edition is installed.
0x00004000 Windows Server 2003, Compute Cluster Edition is installed.
0x00000080 Windows Server 2008 Datacenter, Windows Server 2003, Datacenter Edition or Windows 2000 Datacenter Server is installed.
0x00000002 Windows Server 2008 Enterprise, Windows Server 2003, Enterprise Edition, Windows 2000 Advanced Server, or Windows NT Server 4.0 Enterprise Edition is installed.
0x00000040 Windows XP Embedded is installed.
0x00000200 Windows Vista Home Premium, Windows Vista Home Basic, or Windows XP Home Edition is installed.
0x00000100 Remote Desktop is supported, but only one interactive session is supported. This value is set unless the system is running in application server mode.
0x00000001 Microsoft Small Business Server was once installed on the system, but may have been upgraded to another version of Windows.
0x00000020 Microsoft Small Business Server is installed with the restrictive client license in force.
0x00002000 Windows Storage Server 2003 R2 or Windows Storage Server 2003 is installed.
0x00000010 Terminal Services is installed. This value is always set. If this value is set but 0x00000100 is not set, then the system is running in application server mode.
0x00008000 Windows Home Server is installed.
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top