Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PHP Constants

PHP provides a set of predefined global constants.

The set of predefined variables changes with PHP versions: for example, in version 8.0, T_READONLY was not defined, and appeared in version 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