Given a PHP class would be the best and simplest way to override one or two of its methods with one
Posted
by racl101
on Stack Overflow
See other posts from Stack Overflow
or by racl101
Published on 2010-05-21T18:05:36Z
Indexed on
2010/05/21
18:10 UTC
Read the original article
Hit count: 155
Here's the objective. I have a PHP class and there are one or two of its methods that I would like to override with my own. As I understand OOP (in PHP and in general) I could write a child class that extends it and overrides the functionality of the methods in question.
However, I was wondering if this is the best way of achieving this task and if this is a proper use for child classes or if there is something better in PHP for what I'm trying to do.
© Stack Overflow or respective owner