[PHP] Re: Convert an array in an object instance

2004-10-25 Thread M. Sokolewicz
Francisco M. Marzoa Alonso wrote: Hi, Is it possible to convert an array in an object instance? I can convert an object in an array as follows: $Test = new MyClass (); $TestArray = (array) $Test; Then I've an array with all members of the object $Test, but it seems that I cannot simply do:

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
[EMAIL PROTECTED] wrote: No. You need to remember that in most cases where you cast a variable from one type to another, you will experience data (precision) loss. This is also the case in converting an object to an array. Only the properties are copied over (since functions can not be part of an

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Marek Kilimajer
Francisco M. Marzoa Alonso wrote: [EMAIL PROTECTED] wrote: No. You need to remember that in most cases where you cast a variable from one type to another, you will experience data (precision) loss. This is also the case in converting an object to an array. Only the properties are copied over

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
Marek Kilimajer wrote: Francisco M. Marzoa Alonso wrote: [EMAIL PROTECTED] wrote: No. You need to remember that in most cases where you cast a variable from one type to another, you will experience data (precision) loss. This is also the case in converting an object to an array. Only the

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Curt Zirzow
* Thus wrote Francisco M. Marzoa Alonso: FYI, the reason I need this is because I'm creating my own object's serialization routines. Why would you want to do this? Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
Curt Zirzow wrote: * Thus wrote Francisco M. Marzoa Alonso: FYI, the reason I need this is because I'm creating my own object's serialization routines. Why would you want to do this? I was walking through the forest when, suddenly, a white light comes from the west through the trees