php - OOP_PHP - Difference between an Instance of a classA and an empty classB that inherits from classA -


in case classa public . need know difference . in others words . benefits got when (extending empty classb public class a) instead of (using instance of classa) . , vice versa ..

there several cases.

  1. while refactoring need rename class keep legacy code working.
  2. it's exception type used discriminator.
  3. it's alias. example, mysql has synonyms tinyint(1) , boolean.
  4. ...

i think there more cases.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -