PHP Constants

PHP provides a set of predefined global constants.

The set of predefined variables changes with PHP versions: for example, in PHP 8.0, T_READONLY was not defined, and appeared in PHP 8.1.

It is possible to list all available PHP native constants with the function get_declared_constants().

<?php

    print E_ALL;

    print PHP_VERSION;

?>

Documentation

See also Understanding PHP Constants: A Simple Guide with Examples.

Related : Superglobal Variables, Variables, Native, DIRECTORY_SEPARATOR, New Line, Predefined Constants