Sub (prefix)

sub is a prefix, that is added to existing structure, to express that they are depending on a larger similar structure, which acts as a parent

It applies to several concepts:

  • subclasses: classes that extends another class

  • subnamespaces: a namespace that share a prefix with another one

While sub- is a generic prefix, it is not applied to every possible words, as they are seldom used. It may still produce neologisms, which sound funny, but may become mainstream. For example, a sub-interface makes sense, but is not used; a sub-trait makes no sense.

<?php

namespace A { }

// this is a subnamespace
namespace A\B { }

?>

Related : Subnamespaces, Subclass