PHP Classes Extend

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-04-24T02:00:02Z Indexed on 2010/04/24 2:03 UTC
Read the original article Hit count: 305

Filed under:
|
|
|
|

I have two classes that work seperate from another, but they extend the same class. Is it possible to have them work the same instance of the extended class. I'm wanting the constructor of the extended class to run only once.

I know this isn't right but something like this:

<?php
$oApp = new app;
class a extends $oApp {}
class b extends $oApp {}

© Stack Overflow or respective owner

Related posts about php

Related posts about php5