Translations:Developers/Object oriented programming in PHP/Classes/34/en

Example compositon vs. inheritance:
 * Class A has m possibilities doing something.
 * Class B has n possibilities doing something.
 * Maximum number of possibilities using one parent class A and a direct subclass B is m + n.
 * Maximum number of possibilities using two parallel classes A and B on the same hierarchical level is m x n.