Hi again,
> > But still, I don't like being at the mercy of the language...
>
> With any language you are at mercy of the specs. Specs for PHP(4) say,
> everything is passed by value (unless you tell is otherwise). But you
> found that out already :)
I'm diggin' that freaky groove - <sigh>
> You could have saved yourself a lot of frustration if you had found this
> url: http://www.php.net/manual/en/language.references.php
A lot of good information there; good, intricate information. My
tiny-little-mind is already on its way towards the TV.
Lots of situations that create copies, that I would never have thought of,
never (that second never is so I don't end on a preposition). I guess I'm
just going to have to be super careful every time I do anything with
objects, quit my whining, and eventually it should become second nature to
me (the part about dealing with objects, not quitting the whining), right?
Thank you again [very much] for your help.
....
Just while I'm here, one thing I read at
'http://www.php.net/manual/en/language.references.whatdo.php'
-snip php.net--------------------
*Warning*
Complex arrays are sometimes rather copied than referenced. Thus following
example will not work as expected.
Example 19-3. References with complex arrays
<?php
$top = array(
'A' => array(),
'B' => array(
'B_b' => array(),
),
);
$top['A']['parent'] = &$top;
$top['B']['parent'] = &$top;
$top['B']['B_b']['data'] = 'test';
print_r($top['A']['parent']['B']['B_b']); // array()
?>
-end snip php.net-----------------
What does, 'Complex arrays are sometimes rather copied than referenced',
mean? Particularly the use of the word, 'sometimes'? When? The suspense! Or
is the example the only case? Also, I don't understand the example.
Where/why does the copy actually take place? I'm trying to trace what might
be hippin'n-a'happenin' by following it in my mind, (along with a little
debugging the code), but I don't get it!
Little more help, please?
Thank you,
MRe.