assign to object by offset
| From: | Rob Richards | Date: | Wed, 04 Feb 2004 14:17:13 +0000 |
| Subject: | assign to object by offset | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-7538@lists.php.net to get a copy of this message | ||
Is there any reason that zend_assign_to_object always converts the property to a string when
it's a variable?
Looking at simpexml, there is no way to distinguish between writing to an element or to an attribute
when using variables.
$sxe[0] = "a"; works fine, but $i=0; $sxe[$i] = "a"; doesnt as $i is sent to the
write_dimension function as a string while 0 is passed as is.
Due to this $sxe[0] will write the value to the element, while $sxe[$i] will write it to the
attribute.
Reading however works fine as no conversion is done on the zval.
Thanks,
Rob