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

Compatibility

Compatibility refers to the ability of two or more things to work together without conflicts or issues.

Compatibility may refer to:

  • Version compatibility, when code works in both versions
  • System compatibility, when code works on different operating systems
  • Method compatibility, when methods are compatible in the parent and the child class.
<?php

    class Elephpant {
        function trumpet(int $trunk) {}
    }

    class AfricanElephpant extends Elephpant {
        // The type must be compatible with the one of the parent
        // The name does not have to be the same as in the parent
        function trumpet(int|null $tusk) {}
    }

?>

Documentation

See Also