php extending but with a new constructor...possible?

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-04-02T03:49:15Z Indexed on 2010/04/02 3:53 UTC
Read the original article Hit count: 191

Filed under:

I have a class:

class test {
    function __construct() {
        print 'hello';
    }
    function func_one() {
        print 'world';
    }
}

what I would like to do is a have a class that sort of extends the test class. I say 'sort of', because the class needs to be able to run whatever function the test class is able to run, but NOT run the construct unless I ask it to. I do not want to override the construct. Anyone has any idea how to achieve this?

© Stack Overflow or respective owner

Related posts about php