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

supertype

A supertype is any of the parent types. It is the class that is extended, in a class definition, with the extends keyword; it also covers all the classes that are a supertype of that parent class.

The opposite is subtype.

<?php

    // Agrandparent is a supertype of AChild
    class Agrandparent {}
    
    // Aparent is a supertype of AChild
    class Aparent extends Agrandparent {}
    
    class Achild extends Aparent{}
    
    // These are not supertype of AChild
    class ABrother extends Aparent{}
    
    class ASister extends Aparent{}

?>

Documentation

See Also