What goBoating described is a 'symbolic reference' in that, since $foo was not a reference (he actually defined it as 'cars') it was taken to become the actual name of the array: @$foo is the same as @cars
However, if $foo was a reference (to a possibly anonymous array) it could've been defined as:
$foo = ['this','that','other'];
and
@foo or @cars or any other incarnation wouldn't exist. In order to access those array elements, you would have to use the reference to them: $foo
This could be accomplished in many ways:
$foo->[0];
@{$foo}[0];
@$foo[0]
They all mean the same thing. So it's possible that this is a hard reference (rather than a symbolic reference) to an array, having a value (contents of $foo) appended to the end of it.
By the way that's what the push() function does, it pushes a value onto the end of an array. I figure that's not the brunt of your question though.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.