PHP5: Abstract Class VS Overloading

Discussion in 'PHP' started by joebert, Nov 26, 2007.

  1. #1
    I appear to be able to do similar things with Abstract Classes as I can do with Overloading. I just need to use different syntaxes.

    When should I be using Abstract Classes, & when should I be using Overloading ?
     
    joebert, Nov 26, 2007 IP
  2. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #2
    You should use abstract classes if you have one typical class with some methods skeleton, and several/many overriding classes derived from this one. PHP will force you to implement all abstract methods in the each child class.
     
    wmtips, Nov 26, 2007 IP