Re: Unserialize a single array element in a constant?

richbl_at_gmail.com
Date: 03/19/05


Date: 19 Mar 2005 08:12:41 -0800

Thanks for the clarification, Brion.

However, constants can contain arrays, BUT they must first be
serialized, and... where I had my particular question, it is the case
that they must then be unserialized first before accessing them. Though
I suppose, technically, if an array is first serialized before
define()'d, one could argue that what's actually contained in the
constant is a string (a scalar which CAN be stored as a constant).

In any case, it would be very hard to defend the act of creating a
constant array from any kind of performance metric: I'm quite certain
that the overhead of first serializing and then unserializing such a
structure is, while not prohibitive, expensive.

I have my answers.

thanks again,

rich



Relevant Pages