Assume: $p contains the variable-name '$A3' of an array.
For both:
Code: Select all
$ele2 = *$p[2]; // copy 1 element of array
*$p[2] = 'X2'; // set 1 element of array(*$p)[2] or *($p[2])
I'd expect (and wish) the first version - as the comments describe.
(The 2nd version doesn't help much, and is simple to emulate.)
For
$ele2 = *$p[2]; the element, i.e. [2], is ignored: the complete array is copied.For
*$p[2] = 'X2'; it seems nothing happens. ($A3[2] is not changed)
XYplorer Beta Club