tags:

views:

43

answers:

2

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
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
+2  A: 
Delan Azabani
Don't say "point". he'll think there's some difference between $a, $b and $c (like a pointer and a pointed).
Artefacto