Here is the list of New Global Constants in php 7. Below is the syntax how you can use PHP global variables inside your code.
1 define(name, value, case-insensitive)
Examples to use PHP global variables
1 2 3 4 | <?php define("GREETING", "Welcome to freewebmentor.com"); echo GREETING; ?> |
PHP_INT_MIN
IMG_WEBP
(as of PHP 7.0.10)JSON_ERROR_INVALID_PROPERTY_NAME
JSON_ERROR_UTF16
LIBXML_BIGLINES
PREG_JIT_STACKLIMIT_ERROR
POSIX_RLIMIT_AS
POSIX_RLIMIT_CORE
POSIX_RLIMIT_CPU
POSIX_RLIMIT_DATA
POSIX_RLIMIT_FSIZE
POSIX_RLIMIT_LOCKS
POSIX_RLIMIT_MEMLOCK
POSIX_RLIMIT_MSGQUEUE
POSIX_RLIMIT_NICE
POSIX_RLIMIT_NOFILE
POSIX_RLIMIT_NPROC
POSIX_RLIMIT_RSS
POSIX_RLIMIT_RTPRIO
POSIX_RLIMIT_RTTIME
POSIX_RLIMIT_SIGPENDING
POSIX_RLIMIT_STACK
POSIX_RLIMIT_INFINITY
ZLIB_ENCODING_RAW
ZLIB_ENCODING_DEFLATE
ZLIB_ENCODING_GZIP
ZLIB_FILTERED
ZLIB_HUFFMAN_ONLY
ZLIB_FIXED
ZLIB_RLE
ZLIB_DEFAULT_STRATEGY
ZLIB_BLOCK
ZLIB_FINISH
ZLIB_FULL_FLUSH
ZLIB_NO_FLUSH
ZLIB_PARTIAL_FLUSH
ZLIB_SYNC_FLUSH
Reference: https://www.php.net/manual/en/migration70.constants.php
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.