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:
[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
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
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
* 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:
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
6 matches
Mail list logo