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

Eponymous

Eponymous means that it carries the same name. For example, a variable called $variable, or a constant called CONSTANT.

PHP does not allow every structure to be eponymous. It is not possible to call a class class, but one may call a class anonymous: this won’t be eponymous, as an anonymous class doesn’t have a name.

<?php

    const CONSTANT = 'literal';
    
    $variable = CONSTANT;

?>

Documentation

See Also