PHP Doku:: Vordefinierte Konstanten - reserved.constants.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchAppendicesListe der reservierten WörterVordefinierte Konstanten

Ein Service von Reinhard Neidl - Webprogrammierung.

Liste der reservierten Wörter

<<Vordefinierte Klassen

Liste der Ressource-Typen>>

Vordefinierte Konstanten

Vordefinierte Core-Konstanten

Diese Konstanten wurden definiert vom PHP-Core. Diese beziehen sich auch auf die PHP-, Zend-Engine- und SAPI-Module.

PHP_VERSION (string)
PHP_MAJOR_VERSION (integer)
Verfügbar seit PHP 5.2.7.
PHP_MINOR_VERSION (integer)
Verfügbar seit PHP 5.2.7.
PHP_RELEASE_VERSION (integer)
Verfügbar seit PHP 5.2.7.
PHP_VERSION_ID (integer)
Verfügbar seit PHP 5.2.7.
PHP_EXTRA_VERSION (string)
Verfügbar seit PHP 5.2.7.
PHP_ZTS (integer)
Verfügbar seit PHP 5.2.7.
PHP_DEBUG (integer)
Verfügbar seit PHP 5.2.7.
PHP_MAXPATHLEN (integer)
Verfügbar seit PHP 5.3.0.
PHP_OS (string)
PHP_SAPI (string)
Verfügbar seit PHP 4.2.0. Siehe auch php_sapi_name().
PHP_EOL (string)
Verfügbar seit PHP 4.3.10 und PHP 5.0.2.
PHP_INT_MAX (integer)
Verfügbar seit PHP 4.4.0 und PHP 5.0.5.
PHP_INT_SIZE (integer)
Verfügbar seit PHP 4.4.0 und PHP 5.0.5.
DEFAULT_INCLUDE_PATH (string)
PEAR_INSTALL_DIR (string)
PEAR_EXTENSION_DIR (string)
PHP_EXTENSION_DIR (string)
PHP_PREFIX (string)
Verfügbar seit PHP 4.3.0.
PHP_BINDIR (string)
PHP_LIBDIR (string)
PHP_DATADIR (string)
PHP_SYSCONFDIR (string)
PHP_LOCALSTATEDIR (string)
PHP_CONFIG_FILE_PATH (string)
PHP_CONFIG_FILE_SCAN_DIR (string)
PHP_SHLIB_SUFFIX (string)
Verfügbar seit PHP 4.3.0.
PHP_OUTPUT_HANDLER_START (integer)
PHP_OUTPUT_HANDLER_CONT (integer)
PHP_OUTPUT_HANDLER_END (integer)
E_ERROR (integer)
E_WARNING (integer)
E_PARSE (integer)
E_NOTICE (integer)
E_CORE_ERROR (integer)
E_CORE_WARNING (integer)
E_COMPILE_ERROR (integer)
E_COMPILE_WARNING (integer)
E_USER_ERROR (integer)
E_USER_WARNING (integer)
E_USER_NOTICE (integer)
E_DEPRECATED (integer)
Verfügbar seit PHP 5.3.0.
E_USER_DEPRECATED (integer)
Verfügbar seit PHP 5.3.0.
E_ALL (integer)
E_STRICT (integer)
Verfügbar seit PHP 5.0.0.
__COMPILER_HALT_OFFSET__ (integer)
Verfügbar seit PHP 5.1.0.
TRUE (boolean)
Siehe Booleans.
FALSE (boolean)
Siehe Booleans.
NULL (boolean)
Null.

Vordefinierte Standard-Konstanten

Diese Konstanten sind in PHP automatisch definiert.

EXTR_OVERWRITE (integer)
EXTR_SKIP (integer)
EXTR_PREFIX_SAME (integer)
EXTR_PREFIX_ALL (integer)
EXTR_PREFIX_INVALID (integer)
EXTR_PREFIX_IF_EXISTS (integer)
EXTR_IF_EXISTS (integer)
SORT_ASC (integer)
SORT_DESC (integer)
SORT_REGULAR (integer)
SORT_NUMERIC (integer)
SORT_STRING (integer)
CASE_LOWER (integer)
CASE_UPPER (integer)
COUNT_NORMAL (integer)
COUNT_RECURSIVE (integer)
ASSERT_ACTIVE (integer)
ASSERT_CALLBACK (integer)
ASSERT_BAIL (integer)
ASSERT_WARNING (integer)
ASSERT_QUIET_EVAL (integer)
CONNECTION_ABORTED (integer)
CONNECTION_NORMAL (integer)
CONNECTION_TIMEOUT (integer)
INI_USER (integer)
INI_PERDIR (integer)
INI_SYSTEM (integer)
INI_ALL (integer)
M_E (float)
M_LOG2E (float)
M_LOG10E (float)
M_LN2 (float)
M_LN10 (float)
M_PI (float)
M_PI_2 (float)
M_PI_4 (float)
M_1_PI (float)
M_2_PI (float)
M_2_SQRTPI (float)
M_SQRT2 (float)
M_SQRT1_2 (float)
CRYPT_SALT_LENGTH (integer)
CRYPT_STD_DES (integer)
CRYPT_EXT_DES (integer)
CRYPT_MD5 (integer)
CRYPT_BLOWFISH (integer)
DIRECTORY_SEPARATOR (string)
SEEK_SET (integer)
SEEK_CUR (integer)
SEEK_END (integer)
LOCK_SH (integer)
LOCK_EX (integer)
LOCK_UN (integer)
LOCK_NB (integer)
HTML_SPECIALCHARS (integer)
HTML_ENTITIES (integer)
ENT_COMPAT (integer)
ENT_QUOTES (integer)
ENT_NOQUOTES (integer)
INFO_GENERAL (integer)
INFO_CREDITS (integer)
INFO_CONFIGURATION (integer)
INFO_MODULES (integer)
INFO_ENVIRONMENT (integer)
INFO_VARIABLES (integer)
INFO_LICENSE (integer)
INFO_ALL (integer)
CREDITS_GROUP (integer)
CREDITS_GENERAL (integer)
CREDITS_SAPI (integer)
CREDITS_MODULES (integer)
CREDITS_DOCS (integer)
CREDITS_FULLPAGE (integer)
CREDITS_QA (integer)
CREDITS_ALL (integer)
STR_PAD_LEFT (integer)
STR_PAD_RIGHT (integer)
STR_PAD_BOTH (integer)
PATHINFO_DIRNAME (integer)
PATHINFO_BASENAME (integer)
PATHINFO_EXTENSION (integer)
PATH_SEPARATOR (string)
CHAR_MAX (integer)
LC_CTYPE (integer)
LC_NUMERIC (integer)
LC_TIME (integer)
LC_COLLATE (integer)
LC_MONETARY (integer)
LC_ALL (integer)
LC_MESSAGES (integer)
ABDAY_1 (integer)
ABDAY_2 (integer)
ABDAY_3 (integer)
ABDAY_4 (integer)
ABDAY_5 (integer)
ABDAY_6 (integer)
ABDAY_7 (integer)
DAY_1 (integer)
DAY_2 (integer)
DAY_3 (integer)
DAY_4 (integer)
DAY_5 (integer)
DAY_6 (integer)
DAY_7 (integer)
ABMON_1 (integer)
ABMON_2 (integer)
ABMON_3 (integer)
ABMON_4 (integer)
ABMON_5 (integer)
ABMON_6 (integer)
ABMON_7 (integer)
ABMON_8 (integer)
ABMON_9 (integer)
ABMON_10 (integer)
ABMON_11 (integer)
ABMON_12 (integer)
MON_1 (integer)
MON_2 (integer)
MON_3 (integer)
MON_4 (integer)
MON_5 (integer)
MON_6 (integer)
MON_7 (integer)
MON_8 (integer)
MON_9 (integer)
MON_10 (integer)
MON_11 (integer)
MON_12 (integer)
AM_STR (integer)
PM_STR (integer)
D_T_FMT (integer)
D_FMT (integer)
T_FMT (integer)
T_FMT_AMPM (integer)
ERA (integer)
ERA_YEAR (integer)
ERA_D_T_FMT (integer)
ERA_D_FMT (integer)
ERA_T_FMT (integer)
ALT_DIGITS (integer)
INT_CURR_SYMBOL (integer)
CURRENCY_SYMBOL (integer)
CRNCYSTR (integer)
MON_DECIMAL_POINT (integer)
MON_THOUSANDS_SEP (integer)
MON_GROUPING (integer)
POSITIVE_SIGN (integer)
NEGATIVE_SIGN (integer)
INT_FRAC_DIGITS (integer)
FRAC_DIGITS (integer)
P_CS_PRECEDES (integer)
P_SEP_BY_SPACE (integer)
N_CS_PRECEDES (integer)
N_SEP_BY_SPACE (integer)
P_SIGN_POSN (integer)
N_SIGN_POSN (integer)
DECIMAL_POINT (integer)
RADIXCHAR (integer)
THOUSANDS_SEP (integer)
THOUSEP (integer)
GROUPING (integer)
YESEXPR (integer)
NOEXPR (integer)
YESSTR (integer)
NOSTR (integer)
CODESET (integer)
LOG_EMERG (integer)
LOG_ALERT (integer)
LOG_CRIT (integer)
LOG_ERR (integer)
LOG_WARNING (integer)
LOG_NOTICE (integer)
LOG_INFO (integer)
LOG_DEBUG (integer)
LOG_KERN (integer)
LOG_USER (integer)
LOG_MAIL (integer)
LOG_DAEMON (integer)
LOG_AUTH (integer)
LOG_SYSLOG (integer)
LOG_LPR (integer)
LOG_NEWS (integer)
LOG_UUCP (integer)
LOG_CRON (integer)
LOG_AUTHPRIV (integer)
LOG_LOCAL0 (integer)
LOG_LOCAL1 (integer)
LOG_LOCAL2 (integer)
LOG_LOCAL3 (integer)
LOG_LOCAL4 (integer)
LOG_LOCAL5 (integer)
LOG_LOCAL6 (integer)
LOG_LOCAL7 (integer)
LOG_PID (integer)
LOG_CONS (integer)
LOG_ODELAY (integer)
LOG_NDELAY (integer)
LOG_NOWAIT (integer)
LOG_PERROR (integer)

4 BenutzerBeiträge:
- Beiträge aktualisieren...
soywiz at gmail dot com
19.01.2009 12:32
Another way to determine PHP_INT_MIN:

<?php
define
('PHP_INT_MIN', ~PHP_INT_MAX);
?>

It should work always:

MAX for 8bit-signed: 01111111
MIN for 8bit-signed: 10000000

In 32 bits:
php -r"echo (int)base_convert(str_repeat('1', 31), 2, 10) - PHP_INT_MAX;"
0
<?php echo ~(int)base_convert(str_repeat('1', 31), 2, 10); ?>
-2147483648
isonomia
8.05.2008 14:18
As PHP_INT_MAX is only available since PHP 4.4.0 and PHP 5.0.5 here is a function that should enable sensible values on most machines (16,32 & 64bit):-

<?php
function get_int_max()
{
   
$max=0x7fff;
   
$probe = 0x7fffffff;
    while (
$max == ($probe>>16))
    {
       
$max = $probe;
       
$probe = ($probe << 16) + 0xffff;
    }
    return
$max;
}

if (!
defined('PHP_INT_MAX'))
{
   
define ('PHP_INT_MAX', get_int_max());
}
define ('PHP_INT_MIN', (int)(PHP_INT_MAX+1));
?>
monky at kymp dot net
12.01.2008 20:55
You can get minimum integer size by adding 1 to PHP_INT_MAX. Just remember to use casting.

<?php

echo (int)(PHP_INT_MAX+1);

?>
Tea Bore
28.09.2005 21:09
Use get_defined_constants() to retrieve these constants.

<?php

print '<pre>';
print_r(get_defined_constants());
print
'</pre>';

?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)