--- Robert Cummings <[EMAIL PROTECTED]> wrote: > Andrey Hristov wrote: > > > > But dereferncing like this > > $foo->bar()->fubar > > is feature of Z2 or not? > > Till today I didn't know that my 4.1.1(or 2) not sure can do this kind of > dereferencing. > > The above quote dereference involves an intermediate method, the one > described in the example below uses an object which is currently > supported. > > > > $foo = new foo(); > > > $foo->bar->set_tmp("outside foo"); > > > $foo->variable = "foo"; > > As far as references go... I believe when you copy an object it is a > shallow copy, in otherwords, the object is copied, but not its members. > This behaviour is preferrable as far as I'm concerned. If you want a > deep copy try doing the following: > > $foo = new foo(); > $fee = unserialize( serialize( $foo ) ); > > That should provide a nice quick, clean solution for what you want while > not incurring the overhead most programmers would rather skip on every > object copy.
I shouldn't have to $fee = unserialize( serialize( $foo ) ) everytime i want to get a copy of an object when the engine says it copys. That is FAR from 'clean'. A possible soultion for this to get around the speed vs functionality. The engine could keep track of a copy and when and only when a member gets change that is when it should make the copy of the member objects. So you get the speed but it is transparent to the user. - Brad > > Cheers, > Rob. > -- > .-----------------. > | Robert Cummings | > :-----------------`----------------------------. > | Webdeployer - Chief PHP and Java Programmer | > :----------------------------------------------: > | Mail : mailto:[EMAIL PROTECTED] | > | Phone : (613) 731-4046 x.109 | > :----------------------------------------------: > | Website : http://www.webmotion.com | > | Fax : (613) 260-9545 | > `----------------------------------------------' > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php