If I make a copy of a reference variable. Is the new variable a pointer or does it hold the value of the variable the pointer was referring to?
+2
A:
Let's make a quick test:
<?php
$base = 'hello';
$ref =& $base;
$copy = $ref;
$copy = 'world';
echo $base;
Output is hello, therefore $copy isn't a reference to %base.
Crozin
2010-05-15 12:42:00
Which should be expected - the point of `$ref` being a reference to `$base` is that `$copy = $ref` should have the exact same effect as `$copy = $base`.
Tgr
2010-05-15 13:06:56
Don't say "point". he'll think there's some difference between $a, $b and $c (like a pointer and a pointed).
Artefacto
2010-05-15 13:51:24