Re[2]: [PEAR] Cloned Object Behavior
| From: | catch12 at holotech dot net | Date: | Sun, 02 Jan 2011 16:39:49 +0000 |
| Subject: | Re[2]: [PEAR] Cloned Object Behavior | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30893@lists.php.net to get a copy of this message | ||
> A clone is not a reference, which means after it's cloned, it's a
> separate object.
Yes, this is what I would expect. The $format_bold object has the bold
property; I clone it to $format_bold_ul and set the underline property
on that, and I would expect that cells which have $format_bold_ul
applied to them would have bold and underline, but all I get is bold,
even though, according to the print_r() output, $format_bold_ul does
indeed have the underline property set.
--
Alan Little
Holotech Enterprises
On Sunday, January 2, 2011, 9:19:46 AM, you wrote:
> Hello Alan,
>> If I clone a format object in Spreadsheet_Excel_Writer, then modify
>> the properties of the clone, those are not reflected in the final
>> output. Example (I've snipped irrelevant properties from the print_r()
>> output)
>>
>> As you can see, the underline property has been set in the clone, but
>> does not appear in the output. Is this normal behavior, a peculiarity
>> of cloned objects, or a bug in Spreadsheet_Excel_Writer?
> A clone is not a reference, which means after it's cloned, it's a
> separate object.