Re: Copying an Object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maybe statics members can help you with this ...

On Wed, Sep 22, 2010 at 07:35, Daniel Kolbo <kolb0057@xxxxxxx> wrote:

> Hello PHPers,
>
> I have:
>
> class A {
>        ...code
> }
>
> class B extends A {
>        ...code
> }
>
> $a = new A();
>
> $b = new B();
>
> I would like to get all of the properties of $a into $b by value.  Class
> A extends 3 other classes.  I would like a way to not have to manage a
> 'copy' method in B if A or one of the subclasses of A change.
>
> I was reading about clone, but this doesn't really seem to help me in
> this situation.
>
> How can I copy $a into $b?
>
> Thanks,
> dK
> `
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Ellis  1100101000111101

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux